Wednesday, December 13, 2006

MySQL Stored Procedure

Ok, i was long time not write about a IT. Now i want to explain about MySQL Stored Procedure in my stupied definition.
Mysql Store Procedure basic syntax is :
Delimiter $$
CREATE PROCEDURE test()
BEGIN
//the program (body)
END$$
DELIMITER ;

Why you must use delimiter? because int the body of SP use a ; (semicolon) for running some query.

next, weakness of mysql store procedure :
  1. You cannot union a temporary table.
  2. If you have an parameters, the length of actual paramters must be same in a store procedure paramters.
  3. Your alias field in store procedure, must be different. Because it can be errors in a .net programme.
  4. You cannot insert the return of store procedure in some table, like in a Ms SQL (insert into <> exec <>. oke, that's my review...... Correct me if i wrong....