I came to know about
MySQL procedure. Can someone tell me
how to use it and why it is used? Any external link or examples will be highly appreciable.
closed as not a real question by Derek Downey, Phil, Aaron Bertrand, Mark Storey-Smith, JNK♦ Sep 6 '12 at 12:44
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
This answer is intended to be a jumping off point for further research.
A MySQL stored procedure is a set of queries moved to the back-end and encapsulated behind a call interface. This is typically used to give a procedural interface to database functionality.
It is commonly used so that you can enforce business logic in the database that you might not be able to do otherwise. For example, you might be able to use a procedure to ensure that all data inserted conforms to the TRADITIONAL sql_mode even if the application tries to set it otherwise. This may be useful if you want to make sure that no application can insert zero dates into a table for example. You can also tie queries together so that they must be executed together.
Procedures are somewhat controverisal. Google, however, is your friend. In the future you might find that using this site as a substitute for initial research may be a good recipe for downvotes.