MySQL Forums
Forum List  »  Stored Procedures

Error Code : 1064.check the manual ... to use near 'DELIMITER $$
Posted by: Juan Martinez
Date: May 25, 2010 02:19PM

Hy, Im doing the next:
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `EpisodiosProcedure`(IN EPIS_ID INTEGER)
BEGIN
DECLARE txn_error INTEGER DEFAULT 0 ;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
SET txn_error = 1;
END;

SAVEPOINT EPISAVEPOINT;




INSERT INTO sene3_visitas_ant
(AVISI_ID,
AVISI_AEPIS_ID,
AVISI_FAMI_ID,
AVISI_NOMBRE,
AVISI_FECHA,
AVISI_HORA_LLEGADA,
AVISI_HORA_SALIDA,
AVISI_OBSERVACIONES,
AVISI_ACTIVO,
AVISI_FECHA_MOD,
AVISI_USUA_MOD)
SELECT VISI_ID, VISI_EPIS_ID, VISI_FAMI_ID, VISI_NOMBRE, VISI_FECHA,
VISI_HORA_LLEGADA, VISI_HORA_SALIDA, VISI_OBSERVACIONES, VISI_ACTIVO,
VISI_FECHA_MOD, VISI_USUA_MOD
FROM sene1_visitas
WHERE sene1_visitas.VISI_EPIS_ID = EPIS_ID;
SELECT 'INSERT INTO sene3_visitas_ant OK' ,concat(' ' , txn_error);



IF txn_error > 0 THEN
ROLLBACK TO EPISAVEPOINT;
SELECT 'INSERT INTO aborted ' ,concat(' t ' , txn_error);
ELSE

DELETE FROM sene1_visitas WHERE sene1_visitas.VISI_EPIS_ID = EPIS_ID;


IF txn_error THEN
ROLLBACK TO EPISAVEPOINT;
SELECT 'DELETE aborted ';
ELSE
SELECT 'OK';
END IF;
END IF;
END $$

MYSQL says: Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$. Why?
Thanks

Options: ReplyQuote


Subject
Views
Written By
Posted
Error Code : 1064.check the manual ... to use near 'DELIMITER $$
6326
May 25, 2010 02:19PM


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.