delete records from target DB2 Table

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sreddy
Participant
Posts: 144
Joined: Sun Oct 21, 2007 9:13 am

delete records from target DB2 Table

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sreddy
Participant
Posts: 144
Joined: Sun Oct 21, 2007 9:13 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply