Oracle Enterprise stage not inserting records

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

abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Oracle Enterprise stage not inserting records

Post by abc123 »

I have a job where data goes from a lookup stage to a transformer on to an Oracle Enterprise stage. All data need to be inserted. I have Upsert with "Insert than Update" as there is no "Insert Only" option. I saw the rejected records and it tries to update all records which means all inserts fail (I captured the rejected records and saw the Oracle code).

This job has been working perfectly before for many months. The only change I made is, in the lookup stage, I changed incoming partitioning to hash based on business key for both incoming links (this is due to a different error in the lookup due to data volume). I also changed the "Preserve partitioning" to Clear. Since then this problem started happening. There are no other messages in the log.

What's interesting is, this problem does not occur on the develoment box, eventhough the datasets involved are much smaller.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Seems to me the first thing to determine is why the inserts are failing. That should be some form of constraint violation - unique index, check constraint, foreign key constraint, etc. And there is a way to do inserts only with that stage, though from what I remember it is a little counter-intuitive - I think you have to select 'update only' then custom sql and use insert DML there... something like that, anyway.
-craig

"You can never have too many knives" -- Logan Nine Fingers
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

I looked at the table structures and other database objects. There are no error messages of any kind. Job runs perfectly but all rows get rejected. This only happens in the test environment not in the development environment.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then add a reject link (if using upsert) to find out WHY they are being rejected. If you are using load method, then look in the sqlldr log file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

I did add a reject link as I said in my earlier post. The SQLCode I get is 1403 which is "no data found" which means that all rows are going to update instead of insert. I put in a condition like 1=2 in the update so that nothing gets updated as I am only looking to do insert only.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

What's wrong with the Load option?
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

I can't use the Load option because I have to supply a value for a sequence column which requires me to do an "User-defined Update & Insert". This works fine in Development and Production environements but not In Test. Has to be some setting difference which I cannot find.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't check the sql code with this design because all you'll see is the reason why the second action, the update failed... 1403... and we don't care. You need to perform strictly the insert so you can determine why it is failing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

Post by theone »

can you identify the cause for that by spliting the job into 2 jobs, do insert in one stage and then update later or vice versa? that could get you to the core cause.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They really don't have any updates to perform. As noted, set Upsert Mode to User-defined Update Only and use an insert statement in the Update SQL field.
-craig

"You can never have too many knives" -- Logan Nine Fingers
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Where on the server can I see the Oracle logs after an insert/update statement?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Only sqlldr creates log files.
-craig

"You can never have too many knives" -- Logan Nine Fingers
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

Post by theone »

If it is is Windows check the installation folder, IBM/Information Server/Server/Scratch
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Regardless of platform, any log files would be in the scratch space defined in your config file. However, only the load option (which leverages sqlldr) creates log files, insert/update does not.
-craig

"You can never have too many knives" -- Logan Nine Fingers
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

Post by theone »

I understand the insert fails and update went good, it could be possible cause of violation of constraints. It shows up in the log and here the case is failure of inserts so it should be saved in the log
Post Reply