Monday, March 30, 2009

How to declare a variable in MySQL Stored Procedure

Hi Friends,

I was very disappointed when i was stuck for almost half an hour just to declare a variable inside the stored procedure in MySQL db.

I searched so many blogs stating many solutions to the problem, but no one suggested the basic solution.

Ultimately i managed to find it by myself, so thought i must share it with biginners of MySQL.

The trick is that the DECLARE statement must follow the BEGIN statement i.e. variables must be declared immediately after BEGIN statement of the stored procedure.




Thats all..
Cheers

3 comments:

Anonymous said...

That is great, thanks for posting that tip!

Anonymous said...

Amiable dispatch and this mail helped me alot in my college assignement. Thank you for your information.

Naviya Nair said...

Great Article
C# Training
C# Online Training
C-Sharp Training
Dot Net Training in Chennai
.Net Online Training
ASP.NET Training