MySQL Forums
Forum List  »  Spanish

Re: problema con un procedimiento almacenado
Posted by: William Chiquito
Date: August 14, 2007 03:34PM

Hola Juan Carlos,

Trata:
DELIMITER $$

DROP PROCEDURE IF EXISTS `guias`.`CiudadInsProc`$$

CREATE PROCEDURE `guias`.`CiudadInsProc`(IN CodCiudad DECIMAL(18,0), IN DesCiudad VARCHAR(1000))
BEGIN
	DECLARE insert_error INT DEFAULT 0;
	DECLARE CONTINUE HANDLER FOR SQLEXCEPTION /*BEGIN*/ SET insert_error = 1;
	START TRANSACTION;
	INSERT INTO Ciudad (CodigoCiudad, DescripcionCiudad) VALUES (CodCiudad, DesCiudad);
	IF insert_error THEN
		ROLLBACK;
	ELSE
		COMMIT;
	END IF;
END$$ 

DELIMITER ;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: problema con un procedimiento almacenado
2157
August 14, 2007 03:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.