Thursday, September 29, 2011

mysql function example

delimiter //
create function mytest () returns char(50) deterministic
declare c int;
select count(*) into c from table;
return c;
delimiter ;

1 comment:

  1. finally a mysql function example I could cut and paste without error and consiquentially having my delimeter go screwy. NB: your table "table" needs to exist in the database or the above will happen to you.