Question & Answer
Question
Create trigger using the DDL extracted with db2look may fail with SQL0104N
Cause
The following is an example of the error received:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "END-OF-STATEMENT" was found following "imezone;
END IF". Expected tokens may include: "<psm_semicolon>". LINE NUMBER=6.
SQLSTATE=42601
This is due to semicolon is used in trigger definition which caused conflict with the statement delimiter character. For example,
CREATE TRIGGER TSMDB1.IMBK_UPD_TRIGGER BEFORE UPDATE ...
FOR EACH ROW BEGIN IF ...
;
END IF; END;
Answer
You can change the statement delimiter. In the above example, you may change the last line of the DDL to :
END IF; END@
Then issue : db2 -td@ -vf trigger.db2
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21701103