MySQL Forums
Forum List  »  Stored Procedures

delimiter not work properly
Posted by: Jasmin Yu
Date: October 07, 2009 08:30AM

I have wrote a store procedure it is find to set it up on one mysql server with version 5.0.45. But the exactly same procedure can not be set up on version 5.0.77.

Here is how I set my procedure and how it looks like. I do suspect it is a bug in version 5.0.77

delimiter//

CREATE PROCEDURE insert1(IN id BIGINT, IN u varchar(2048))
BEGIN
DECLARE t1 BIGINT(20);
DECLARE t2 BIGINT(20);
SET t1 = UNIX_TIMESTAMP(NOW());
SET t2 = t1-1800;
DELETE FROM a WHERE a.entry_date<t2;
insert into a (id, entry_date, u) values (id, t1, u);
END//

delimiter ;

Right after DECLARE t1 BIGINT(20); I will got error:

ERROR 1064 (42000): 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

I was wondering which version is as stable as possible. Though I know I can simply populate the same procedure from other machine to version 5.0.77 machine, by changing the record of mysql.proc table. But it is not a good idea.

Options: ReplyQuote


Subject
Views
Written By
Posted
delimiter not work properly
4927
October 07, 2009 08:30AM
1582
October 07, 2009 09:05AM
1564
October 07, 2009 04:53PM
1477
October 08, 2009 02:29AM
1477
October 08, 2009 02:42AM
1773
October 21, 2009 10:32AM
1483
October 21, 2009 11:24AM


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.