Page 1 of 1

delete records from target DB2 Table

Posted: Thu Jul 22, 2010 7:35 am
by sreddy
Hi

I design two datastage to fetch (not match records ) and delete perticular SRKey records in the table.

First job is Table A is join with Table B using key column SR_KEY using LookuStage. Take two target Sequential files ( Rej_File and Output_File )

Second job Rej_File as source and using transformer stage filter with IND colum transfor only domestic records data to target table . Delete those records in target table ( Delete existing Rows only ).


Problem is First job is working fine, but the second job keep on running.

Any one can given an idea to delete the records in target DB2 table.

Thanks
SReddy

Posted: Thu Jul 22, 2010 7:36 am
by chulett
"keep on running" sounds like a locking problem, have you recruited your DBA to see what is going on in the target table?

Posted: Thu Jul 22, 2010 7:53 am
by sreddy
Thank you Hulett

Ya i raised this issue to my DBA. I explained to him these jobs are working fine when i ran first time on another schema.


I also tried to use below Orchestrate query to delete the records.

DELETE FROM #DBSchema#.DBSLS WHERE SRKEY= ORCHESTRATE.SRKEY;

DELETE FROM #DBSchema#.DBILN WHERE SRKEY= ORCHESTRATE.SRKEY;

The Error is
DB2_SLS_DELETE,0: Warning: SCD_R_SLS_28_All_DeleteOrphans.DB2_SLS_DELETE: [IBM][CLI Driver][DB2/6000] SQL0206N "ORCHESTRATE.SRKEY" is not valid in the context where it is used. SQLSTATE=42703

Posted: Thu Jul 22, 2010 8:01 am
by chulett
It could be as simple as you or someone else, even using another tool, had a record locked outside the job. When it happens again, your DBA should be able to pinpoint if that is the issue.