Stored Procedure in Mysql

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

Stored Procedure in Mysql

Postby hari » Tue Apr 21, 2009 7:13 am

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
hari
 

Re: Stored Procedure in Mysql

Postby prasanth » Tue Apr 21, 2009 7:26 am

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!!
Mr. P

prasanth
 
Posts: 304
Joined: Fri Nov 24, 2006 1:52 am

Re: Stored Procedure in Mysql

Postby DJ » Tue Apr 21, 2009 2:29 pm

Im not programmer but does that have any similarity to ASP.NET stored procedures?
The Deej
|
DJ
Site Admin
 
Posts: 1022
Joined: Thu May 04, 2006 4:47 pm

Re: Stored Procedure in Mysql

Postby silvester » Tue Apr 21, 2009 10:50 pm

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.
silvester
 
Posts: 89
Joined: Mon Nov 10, 2008 12:59 am

Re: Stored Procedure in Mysql

Postby hari » Tue Apr 21, 2009 11:34 pm

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



Return to Programming

Who is online

Users browsing this forum: No registered users and 5 guests