Page 1 of 1

Error in Before Sub routine

Posted: Mon Dec 17, 2007 7:52 pm
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 ???

Posted: Mon Dec 17, 2007 8:39 pm
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. :?