delimeter //
DROP function IF EXISTS get_seq_next//
create function get_seq_next(
IN sequence_ref_ varchar(30)
) returns int(11) unsigned
BEGIN
DECLARE seq_val_ int(11) unsigned;
LOCK TABLE ga_seq_tab WRITE;
select sequence_no into seq_val_ from ga_seq_tab where sequence_ref=sequence_ref_;
if not seq_val_ is null then
update ga_seq_tab set sequence_no=sequence_no+1 where sequence_ref=sequence_ref_;
end if
UNLOCK TABLES;
return seq_val;
END //
DELIMETER ;
我正在尝试创建一个函数,但它一直说我有语法错误,我不确定它有什么问题