mysql - Not allowed to return a result set from a trigger -
i need increment next highest character field upon insert - e.g. if '007' exists, next '008'
i have stored procedure:
begin select lpad(cast(max(line_order) signed integer) + 1,3,'0') bill_project_lineitems item_id = vitem; end
then have trigger:
call maxlineorder(new.item_id,@new.line_order )
which call before.
when try insert, mysql complains: 1415 - 'not allowed return result set trigger'
so how solve problem?
ok, read again , maybe undestood. (but why not pasting full code?) error clear, cant return resultset trigger.
i suppose want issue insert
, resultset. can't. should:
- move
insert
stored procedure drop
triggercall
procedure.
stored procedures can return resultset (or many resultsets), work. hope want.
Comments
Post a Comment