Thursday, January 3, 2008

Stored Procedures in MySQL 5.0

Some people resisted to use MySQL because it had no support for stored procedures. But with MySQL 5.0, it has its new functionality for Stored Procedures. What are stored procedures actually? They are collections of SQL query and procedures that stored and run on the database server.

Before MySQL provides this new feature, MySQL developers need to store their procedures on the application, there hasn’t been an option anyway. And now, this new feature is available on version 5.0, and I am going to discuss why we would want to use stored procedures and place logic on the database server, instead of just put the procedures on the application.


Why use Stored Procedures?
§ They can run in all environments. Since stored procedures are stored in database server, so it doesn’t matter what application environment is used – the logic just remains in one place.

§ Less network traffic. For complex application, it may require complex queries or looped queries to get the desired result; it may generate more network traffic than it should be. By using Stored Procedures, they can cut down the unnecessary long queries being sent back and forth from application and database server, since they are done on the database server.

§ You can fix problems in your application by simply edit the related stored procedures on your database server, instead of changing your application code.

§ Speed of execution. Data manipulation that is done directly on the database server is faster than your application to handle it.

0 comments:

 

Get paid for your opinions! Click on the banner above to join Planet Pulse. Its totally free to sign up, and you can earn UNLIMITED. Find out more by visiting PLANET PULSE.
Sign up for PayPal and start accepting credit card payments instantly. http://www.emailcashpro.com
July Code Blog Copyright © 2010 Blogger Template Designed by Bie Blogger Template