Originally posted by: LouK
We are trying to delete rows from a DB2 tablein a functional map. We have tried using DBQUERY, DBLOOKUP, as well as the PUT command with the DB adapter. The command we are using is:
VALID(PUT("DB", "-TRACE dbdelete.dat" + " -MDQ mdqpath_and_name" + " -UPDATE" +
" -DBNAME " + "DBT_XXX" + " -USER " + "xxxxxxxx" + " -PASSWORD " + "xxxxxxxx" +
" -var TBL_ID = " + FILLRIGHT(FormularyID, " ", 12) + " -var SCHEMA = xxxxx" +
" -Q DeleteRows" + " -TABLE ARGUS.TBL_NDC_LST_STAT_CDE ", ""),
FAIL("Failed while deleting from tbl_ndc_lst_stat_cde" + LASTERRORCODE() + ": " + LASTERRORMSG() ))
The FormularyID is a 10 character field but the column in the table is defined as 12 characters, hence the padding. We're getting an error saying
FAIL function aborted map:Failed when deleting ID xxxx LASTERRORCODE -1070: The database command line was invalid.
The query in the mdq file is as follows:
DELETE from ARGUS.TBL_NDC_LST_STAT_CDE
where ARGUS.TBL_NDC_LST_STAT_CDE.TBL_ID = '#TBL_ID#'
The TargetRule > Put > Target is set to Database with -UPDATE as the command.
Any ideas - am I missing something?
#IBMSterlingTransformationExtender#IBM-Websphere-Transformation-Extender#DataExchange