Stored procedures offer several advantages over embedded SQL.

1: It is easier to write, debug and modify SQL code in a stored procedure
with a tool designed to do that.  You can write PHP from the command line
also but not many people do it.

2: Placing the code in a stored procedure allows you to divorce it from your
other code and debug it separately.

3: It allows for easier division of labor. In our shop, we routinely hand
off the SP's to the data team.

4: Stored procedures allow for a greater degree of code reuse.

But the biggest advantage.
5: Stored procedures are normally (Oracle, MS SQL, Interbase, etc.) compiled
code.  They are compiled once and used in their compiled state until they
are modified.  This offers faster execution than embedded sql, which much be
compiled each time it is submitted.

IMHO,
Cal
http://www.calevans.com


-----Original Message-----
From: John Dean [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 7:50 AM
To: Gary Huntress; Mysql (E-mail)
Subject: Re: No Stored Procedures - Big Deal


Hi
I must agree with you on this point, after what can be done in a stored
procedure can also be done with SQL. The only real advantage I can see to
provide a centralized store of commonly used SQL, but then again these can
be
stored in a text file. The disadvantage is a down grade in performance,
which
is exactly what MySQL tries to avoid.

On Friday 30 March 2001 14:19, Gary Huntress wrote:
> I don't mean to be argumentative, but what is everyones love affair with
> stored procedures?  I like putting my logic in the mid-tier and I'm
> constantly battling my Sybase Admin at work who maligns me whenever they
> spot a query in my code....even a very simple select "oh, I can make that
a
> stored procedure....because what if I change something?"   <me> "then my
> code will break and I'll fix it.....*somebody* always has to change
> something!"
>
> Triggers I can understand, they take away much of my validation headaches
> (and make me correspondingly lazy), but what am I missing about the
panacea
> | paradise | emerald city of stored procedures?
>
>
> Regards,
>
> Gary "SuperID" Huntress
>
> =======================================================
> FreeSQL.org offering free database hosting to developers
> Visit http://superid.dyndns.org:8080/freesql/index.php

--
Regards
John

MySQL Development Team
   __  ___     ____ __   __
  /  |/  /_ __/ __/ __ \/ /   John Dean <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\____/ Mansfield, England, UK
       <___/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to