Hi,

I would like to convert 2 trigger from ORacle database to DB2 database.
Do you know where & what command i shall type to run the DDL script file
i had generated from the SQL-Coversion Workbench Tool in IBM DB2 environment?

Below is the DDL file for create triggers:

CREATE TRIGGER DAtrg_bfrow_branch
before insert or update on branch
for each row
begin
if inserting then
:new.rcdversion := 1;
:new.dtcreated := SYSDATE;
:new.tmcreated := SYSDATE;
:new.usrcreated := USER;
:new.dtupdated := SYSDATE;
:new.tmupdated := SYSDATE;
:new.usrupdated := USER;
elsif updating then
:new.rcdversion := ld.rcdversion + 1;
:new.dtupdated := SYSDATE;
:new.tmupdated := SYSDATE;
:new.usrupdated := USER;
end if;
end;
;

CREATE TRIGGER "EQUITY".DAtrg_afrow_branch
after insert or update on branch
for each row

declare
iErrCode integer;
szErrMsg char(501);

begin

if (ld.rcdversion is not null) and
(:new.rcdversion < ld.rcdversion) then
DA_pkg_exphndlr.DA_sp_disperr(DA_pkg_exphndlr.err_inv_rcdversion, '');
end if;

end;
;

========================================================
To run the create trigger scripts in the 'Command Window', i type the following:

C:\output\> DB2 -f trigger.ddl -t -r output.txt -s -l errorlog.txt

ERROR FOUND:-
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 "CREATE TRIGGER DAtrg_bfrow_branch before i"
was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<revoke>".
SQLSTATE=42601


I am new to DB2, not much sure about the DB2 language.
Can anyone tell me what's wrong with my triggers?
Thank you.


Regards,
Sherlyn