Skip navigation links

MySQL Forums :: Stored Procedures :: 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 '' at line 5


Advanced Search

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 '' at line 5
Posted by: sharmila jasthi ()
Date: October 12, 2009 12:57PM

Hello,

I was writing a trigger in SQLYog. Trigger syntax is

CREATE TRIGGER trigger_bookingId
AFTER INSERT ON bookingmaster
FOR EACH ROW
BEGIN
SELECT COUNT(*) INTO @_i FROM bookingmaster WHERE bookingmaster.BookingDate = CURDATE();
SET @_bookingId := CONCAT( 'BAE_' , CONVERT(CURDATE(),CHAR(20)),'_' ,(@_i + 1));
INSERT INTO bookingmaster(BookingID,BookingDate) VALUES(@_bookingId,CURDATE());
END;

when executed this I got the error 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 '' at line 5

If I executed the statements b/w BEGIN AND END then they are executing fine.

Can anybody please tell me what is the error in this code.

Thanks in advance.

regards,
Sharmila

Options: ReplyQuote


Subject Views Written By Posted
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 '' at line 5 4303 sharmila jasthi 10/12/2009 12:57PM
Re: 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 '' at line 5 1776 Peter Brawley 10/12/2009 08:23PM


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.