Thursday 15 April 2010

plsql - Oracle PL/SQL Trigger Error -


I am trying to get the trigger to update a reportnum and suffix and to be compatible with the Coldfusion ORM To do this work for tables with the same key, I have used the first part of the example below. In this table I need to update the suffix to the next value if the report number is given.

  create table tb1 (report number NUMBER, suffix number NUMBER); Start SEQ1 SEQ1 with 1; Before writing on TB1 for each line, create or replace Trigger "TRG1_TB1" IF: NEW.reportnum NULL SELECT SEQ1.NEXTVAL in: NEW.reportnum Dual; ELSIF: NEW.REPORTNUM = '' Then select seq1.NextTV: NEW.reportnum dual; ELSIF: NEW.suffix = '' Then select MAX (suffix) in +1: Where is tb1 from NEW suffix Reportnum =: NEW.reportnum ELSIF: NEW.suffix = NULL then select MAX (suffix) +1 in: NEW.suffix TB1 to WHERE reportnum =: NEW.reportnum END if; End;   

The error I am getting is that this command is not finished properly.

No comments:

Post a Comment