Yes - from version 5 upwards.
Procedures look like this :
Code:
drop procedure if exists db_log_action;
$
create procedure db_log_action(
IN in_user_id int,
IN in_logType varchar( 20 ),
IN in_logMsg varchar( 200 )
)
begin
if in_logType != 'test' and in_logMsg != 'Searching for logs' then
insert db_Log ( id, logType, updTime, msgTxt )
values ( in_user_id, ifnull(in_logType,'error'),
now(),ifnull( in_logMsg,'EMPTY') );
end if;
end
$
Functions work well too:
Code:
drop function if exists db_return_hello
$
create function db_return_hello(
in_name varchar(250) ) returns varchar(250)
begin
declare v_str varchar(250);
set v_str = concat( 'Hello ', in_name );
return v_str;
end;
$
Mike