How to Capture SQL Error Codes when loading is failed

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
a.thirumoorthi
Participant
Posts: 8
Joined: Mon Jan 08, 2007 1:08 am
Location: Trichy

How to Capture SQL Error Codes when loading is failed

Post by a.thirumoorthi »

Hi,

I have a parallel job to load the data into a table in Oracle database from the sequential file. I need to capture the records with SQL Error code in the reject file if the records are not loaded to the target table due to some SQL errors (say Duplicate Keys, Unique constraint).

Here is my job design

Seq file(source file) ------> Transforer ............> Oracle Table


From Transformer..............> Seqfile (Reject file)


Example - Scenario

source file is having 10 records with two duplicate records

Output

The reject file should contain those two duplicate records and the decription column in the reject file should have like "ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found"


Can anyone help me out on this problem...

Any solution for this problem is really appreciated.............

Thanks
Thiru
Thirumoorthi
say2prabhu1
Participant
Posts: 27
Joined: Mon Jul 09, 2007 1:06 am

Post by say2prabhu1 »

In the Oracle DB target stage,you have to enable output reject records to be true and take a link from that stage and capture it in sequential file..

The design should be
Seq file(source file) ------> Transforer ............> Oracle Table --->Sequential file (Rejected reords )
a.thirumoorthi
Participant
Posts: 8
Joined: Mon Jan 08, 2007 1:08 am
Location: Trichy

Post by a.thirumoorthi »

Hi,

Thanks for ur information.

Yes we have that option "output reject records " in Oracle Enterprise stage only for when write method is Upsert

Can you please tell me the other solutions for this problem


Thanks
Thiru
Thirumoorthi
Post Reply