As I could not get DB2 stage to execute DDL commands which do not return any result set, I am using DSExecute() in a before job subroutine.
First I used:
DB2Cmd1 = "db2cmd; db2 connect to TEST user Administrator using Manish123 ; db2 drop trigger Administrator.TRG_TBL1_INSERT; db2 connect reset;"
Call DSExecute("DOS", DB2Cmd1, ResultText, SystemReturnCode)
If SystemReturnCode = 0 Then
Call DSLogInfo("Success" : ResultText, "tempS")
End
If SystemReturnCode <> 0 Then
Call DSLogInfo("Error" : ResultText, "tempF")
End
It connects to db2 database successfully but does not drop the trigger, but return success status. Possible reason can be: executing "db2cmd; db2 connect to TEST user Administrator using Manish123 ; " on command line opens another window and further DB2/SQL commands need to executed on that window.
I cant find a way to embed into a single executable statement, the whole script from database connect to sql queries.
If I break up the Drop Trigger <triggername> into a separate DSExecute() function then as expected I get " Error: Deleting Insert Trigger DB21061E Command line environment not initialized."
Please suggest some possible way out.
tia,
manish