Stored Procedure in Mysql

Posted:
Tue Apr 21, 2009 7:13 am
by hari
Stored procedures and functions are supported in MySQL 5.1. A stored procedure is a set of SQL statements that can be stored in the server and clients don't need to keep reissuing the individual statements, but can refer to the same stored procedure or function instead.
Here is a link, which gives the basics of mysql stored procedure.
http://www.tutorialized.com/view/tutori ... rial/36961
Re: Stored Procedure in Mysql

Posted:
Tue Apr 21, 2009 7:26 am
by prasanth
And this also makes program run faster especially when there is heavy data in the database..right?
Thanks Hari! This is very useful tutorial to the programmers!!
Re: Stored Procedure in Mysql

Posted:
Tue Apr 21, 2009 2:29 pm
by DJ
Im not programmer but does that have any similarity to ASP.NET stored procedures?
Re: Stored Procedure in Mysql

Posted:
Tue Apr 21, 2009 10:50 pm
by silvester
Dj,
you are right stored procedures are same for all the DBMS , But only the syntax for calling the procedures in each language like differs.
Re: Stored Procedure in Mysql

Posted:
Tue Apr 21, 2009 11:34 pm
by hari
In order to fetch records from a database which is having large number of records, we need to optimize the table fields. To some extend, indexing can be used to reduce the time taken for fetching records in some 'search' criteria.
Stored procedures are mainly used for reducing the network traffic. In most of the cases we are sending request in the form of query to the database to get the desired data and after getting response, sending the second request based on the first one. It will take much time to complete the task. In such cases, we can use stored procedure, because it is stored in the database server and the response of the first request can be used as the request to the second, in the database server itself and no need to go back to the user for the second request.
Re: Stored Procedure in Mysql

Posted:
Tue Apr 28, 2009 12:57 am
by ashik