Page 1 of 1

How to redirect exception to rejects

Posted: Thu Sep 05, 2002 12:32 pm
by idocrm
I am trying to insert some data into a table with PK defined.
The data contains dups, the insert of dups will result in ORA-00001.
How can I send the dups to reject file while continue insert the non-
dups?
Any help is appreciated.

Posted: Thu Sep 05, 2002 12:44 pm
by idocrm
I'm more interested in finding an alternative besides reading/writing to the same Hashed file approach.
Thanks.

Posted: Fri Sep 06, 2002 12:21 am
by chulett
You *should* be able to add another link to the transform that feeds the OCI stage and mark it as a Reject link. Any rows that cause the error will be redirected down the reject row where you can then do whatever you deem appropriate with them, including writing them to a reject file.

Unfortunately, this doesn't work in all versions of DataStage.

-craig

Posted: Fri Sep 06, 2002 5:19 pm
by ariear
As said before add a reject link and use as constraint Link Variables --> Outputs --> DBMSCODE .....
Works for 5.2

Posted: Fri Sep 06, 2002 8:56 pm
by idocrm
I'm using 5.1. I've tried the reject link (test for DBMSCODE="ORA-00001") approach before I posted my question. Didn't seem to work.
Thanks for the help so far guys.

Posted: Sun Sep 08, 2002 8:48 am
by chulett
Try it without any constraints on the Reject link.