-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	5.5.5-10.1.36-MariaDB


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;


--
-- Create schema bd_rojas
--

CREATE DATABASE IF NOT EXISTS bd_rojas;
USE bd_rojas;

--
-- Definition of table `comandos`
--

DROP TABLE IF EXISTS `comandos`;
CREATE TABLE `comandos` (
  `idregistro` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `modelo` varchar(45) NOT NULL,
  `flgtipo` char(1) NOT NULL,
  `comando` varchar(80) NOT NULL,
  PRIMARY KEY (`idregistro`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `comandos`
--

/*!40000 ALTER TABLE `comandos` DISABLE KEYS */;
INSERT INTO `comandos` (`idregistro`,`modelo`,`flgtipo`,`comando`) VALUES 
 (1,'TK 06','A','DY123456 1'),
 (2,'TK 06','E','TY123456 1'),
 (3,'MT 05','A','111111STP'),
 (4,'MT 05','E','111111RES'),
 (5,'VT 600','A','W000000,020,1,1'),
 (6,'VT 600','E','W000000,020,1,0');
/*!40000 ALTER TABLE `comandos` ENABLE KEYS */;


--
-- Definition of procedure `sp_get_lista_comandos`
--

DROP PROCEDURE IF EXISTS `sp_get_lista_comandos`;

DELIMITER $$

/*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_get_lista_comandos`(
   pmodelo varchar(100)
  ,pflatipo varchar(1)
)
BEGIN

select
 idregistro
,modelo
,flgtipo
,comando
from comandos x
where x.modelo=pmodelo
and   x.flgtipo=pflatipo;

END $$
/*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */  $$

DELIMITER ;



/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
