drop procedure if EXISTS register_customer;

DELIMITER $$
CREATE  PROCEDURE `register_customer`(OUT `result_id` INT, IN `nameP` VARCHAR(55), IN `cf1P` VARCHAR(255), IN `cf2P` VARCHAR(255), IN `phoneP` VARCHAR(20), IN `emailP` VARCHAR(100), IN `direccionP` VARCHAR(300), IN `customers_type_idP` INT, IN `estadoP` INT, IN `person_typeP` VARCHAR(20), IN `document_type_idP` INT)
    NO SQL
BEGIN



INSERT INTO `tec_customers`(`name`, `cf1`, `cf2`, 
                            `phone`, `email`, `direccion`, 
                            `customers_type_id`, `estado`, `person_type`, 
                            `document_type_id`) VALUES (
                                nameP, cf1P, cf2P,
                                phoneP, emailP, direccionP,
                                customers_type_idP, estadoP, person_typeP,
                                document_type_idP);

SET result_id :=  (SELECT LAST_INSERT_ID());

END$$
DELIMITER ;