MySQL Forums
Forum List  »  Spanish

problema con un procedimiento almacenado
Posted by: Juan Carlos Arriagada
Date: August 14, 2007 02:32PM

Hola!

estoy comienzando a usar Procedimientos Almacenados (PA) pero no encuentro el error de sintaxis de esta.

¿me podrian ayudar?

DELIMITER $$

DROP PROCEDURE IF EXISTS `guias`.`CiudadInsProc`$$
CREATE PROCEDURE `guias`.`CiudadInsProc` (
IN CodCiudad Decimal(18,0),
IN DesCiudad Varchar(1000))
BEGIN

DECLARE insert_error INTEGER 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$$

Agradecido de antemano.

Options: ReplyQuote


Subject
Views
Written By
Posted
problema con un procedimiento almacenado
3479
August 14, 2007 02:32PM


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.