Error in Before Sub routine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Error in Before Sub routine

Post by cosec »

Hi,

I am having a problem doing a delete in the before sub routine.

The source is a sequential file and the target is a DB2 stage. The job does an insert/update depending on the source.


Table A

A1 B1

A1 is the primary key of Table A
B1 is a foreign key.


When I try to update Table A for eg with contents A1 and B2. I have an error like "The parent key in a parent row of relationship <Constraint> cannot be updated".

To avoid this error in the Before subrouting of the Target DB2 stage I am trying to do delete the record with B1 from the Table B but I get an error message saying wrong number of parameters.


Is it possible to do this deletion without using a lookup ???
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm lost on what you are up to here, but you do realize that the 'Before SQL' tab of the DB2 stage only executes once when the job starts, yes? Not for every row. :?
-craig

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