sql - Syntax error for MySQL function -
delimiter $$ create function ecmsbackoffice.getsequence($delimeter varchar(20)) returns varchar(20) begin declare result varchar(20); set result = 0; if (delimeter='b') update id_generator set seq_currval=(seq_currval+1) seq_name='b'; else if (delimeter='d') update id_generator set seq_currval=(seq_currval+1) seq_name='d'; else if (delimeter='c') update id_generator set seq_currval=(seq_currval+1) seq_name='c'; end if select seq_currval result id_generator seq_name = delimeter; return result; end $$ delimiter ;
i'm trying create mysql function, following error:
error code: 1064
have error in sql syntax; check manual corresponds mysql >server version right syntax use near 'select seq_currval result
id_generator
seq_name = delimeter;
r' @ line 9
what problem?
change else if
elseif
everywhere,
Comments
Post a Comment