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:

  1. move insert stored procedure
  2. drop trigger
  3. call procedure.

stored procedures can return resultset (or many resultsets), work. hope want.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -