[<<][sql][>>][..]
Fri Mar 2 20:48:09 EST 2012

MySQL procedures

DELIMITER //GetAllProducts()
CREATE PROCEDURE GetAllProducts()
  BEGIN
  SELECT *  FROM products;
  END //
DELIMITER ;

From [1], the delimiter is necessary to be able to store multiple
statements in a procedure.  (weird!).

So simple sequencing is simple.  Next: variable binding.

First thing that comes to mind: what's the difference between

procedures and functions?
DELIMITER //
CREATE PROCEDURE addsome()
  BEGIN
  insert if not exists SELECT *  FROM products;
  END //
DELIMITER ;





[1] http://www.mysqltutorial.org/getting-started-with-mysql-stored-procedures.aspx
[2] http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html



[Reply][About]
[<<][sql][>>][..]