Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Stored procedures are a good idea for a number of reason:</p> <p>By putting business logic closer to the data, you are able to have any number of client interface to the data. You may initially design the front end for a web site but now they want reports. No problem, the business logic is next to the data. Open up the APIs, put a web service in front of the procedure. You want to use the hottest new language, go ahead. The business logic is next to the data.</p> <p>Another reason to use stored procedures is that it creates a strong bond between you and the chosen database. This way, you can take advantage of the built in functionality of the DB that you are paying for (or using in case of open source). And guess what, if you try to make your application DB independent you will probably have a number of hard to track down bugs. <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1886476148373" rel="nofollow noreferrer">Read consistency works differently on each vendor's database.</a> </p> <p>You can take advantage of your database built-in scalability (cluster, RAC - however they implement it). No need to write your own.</p> <p>It is harder to write code that does not use bind variables (google soft parses vs hard parses if you need more info on that).</p> <p>Version control - the companies I have always used version control for stored procedures. You normally write stored procedures in some editor. Most editors now have built in support for at least one of the major version control systems.</p> <p>External code has to pull the data across the network and then work with it.</p> <p>Lastly, not all procedural languages are created equally. MySQL just released the ability to use stored procedures and they give you a number of languages you can use including their own. I doubt theirs stand up to Oracle's or SQl Server's. I'm not going to go into who's the best because I am not an expert in anything but Oracle. Oracle's PL/SQL has a lot of functionality that is optimized in the DB kernel. I am sure MS SQL does that too as well others.</p> <p>Hope this is helpful (and makes sense - long day).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload