Creating FUNCTIONS/PROCEEDURES

Hi everybody,

I have the following statement:

SELECT SUM(`Quantity Ordered`) FROM `Sales Detail Information` WHERE
`Catalogue Number` = "FBDCD008";

I can run this as a query in the SQL window, and it works fine.

How could I turn this query into a FUNCTION or perhaps better still a
PROCEEDURE? I am not sure if FUNCTIONS can reference tables...

I am using phpadmin 2.7.0, and My SQL 5.0.15. I would like to get the
statement registered as a FUNCTION/PROCEEDURE so that I can so that I can
select it from the "Function" selector on the "Insert" sub-tab in
myphpadmin. I hope this will enable the column to always hold the current
value for Quantity Sold (the sum total of "Quantity Ordered"). This is the
only way I can think of achieving this goal, unless someone has another
idea?

Any thoughts on this?

Regards,
C.B.
Cerebral Believer [ Sa, 16 September 2006 23:00 ] [ ID #1468673 ]
PHP » alt.php.sql » Creating FUNCTIONS/PROCEEDURES

Vorheriges Thema: Help with a query please !! It works but needs adjusting !
Nächstes Thema: Can anyone help a newbie figure out MySQL?