Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: perl & SQL best practices

by nikosv (Chaplain)
on Apr 28, 2012 at 14:40 UTC ( #967815=note: print w/replies, xml ) Need Help??


in reply to perl & SQL best practices

Think of the stored procedure as a module that encapsulates code into one piece and exposes a public interface.That way when the underlying implementation changes you don't have to change the interface too.With ad-hoc sql you have no such advandage.

Furthermore a stored proc is compiled server side and can be executed faster because of caching. Another advadnage is that you can write triggers that call the procedure when an DB event happens.

The security wise advandage it that you grant access for executing the procedure but you don't have to give access/grant to the underlying tables;you have to sanitize input though.One limitation is that not all DBI/DBD drivers can bind parameters to procedures.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967815]
help
Chatterbox?
[huck]: "and all is quiet..." "Others having an uproarious good time at the Monastery" ... something seems not quite right ...
[huck]: just the first time i noticed the "uproarious" message ... i must be bored

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2017-02-24 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (351 votes). Check out past polls.