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

11 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.

tamilsasi said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
Selenium training in Chennai

Selenium training in Bangalore

Selenium training in Pune

Selenium Online training

Mounika said...

Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
python Training in Pune
python Training in Chennai
python Training in Bangalore

Anu said...

I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone

devops training in chennai | devops training in anna nagar | devops training in omr | devops training in porur | devops training in tambaram | devops training in velachery





KITS ONLINE TRAINING said...

Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
SAP BW on Hana training
sap sd training
osb training
oracle scm training
abinitio training
spark training

Pavithra Devi said...

This post is so interactive and informative.keep update more information...
Salesforce Training in Tambaram
Salesforce Training in Chennai

manasha said...

Great post. keep sharing such a worthy information.
Blue Prism Training in Chennai
Blue Prism Online Training

affordable interior designer said...

It’s interesting content and Great work. Thanks for sharing!

visit - https://lookobeauty.com/best-interior-designer-in-gurgaon/

Akash said...


My thanks go out to you for your thorough explanation of the model's architecture and how it caters to common challenges. I found your blog post helpful in clarifying some technical concepts that I had been struggling with. Keep up the good work."
Python Online Training in Bangalore

القمر السعودى said...

شركة مكافحة الصراصير
مكافحة الصراصير