Oracle UPSERT

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
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Oracle UPSERT

Post by ssreeni3 »

Hi Experts,
Already a select statement is there for Insert Query of Target Oracle stage whose mode is UPSERT.What happens if we write the same query with select statement for Update Query?

I observed this in one of my existed jobs.Is there any specific meaning for it?

Thanks in Advance,
Srini
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Post by ssreeni3 »

Correction to my post:
Already a select statement is there for Insert Query of Target Oracle stage whose mode is UPSERT.What happens if we write the same query for Update?

I observed this in one of my existed jobs.Is there any specific meaning for it?

Thanks in Advance,
Srini
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably not. Depends what you mean by "is there".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Post by ssreeni3 »

Thanks Ray for your reply.

My doubt is:
Which scenarios,we may give the same Select statement to the Update query also.

We are using Change Capture Stage in the Job.

Thanks,
Sreeni
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I honestly doubt you have any kind of a "select statement" in your target.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

Can you please tell us when you say
Select statement to the Update query also
As for as I know, you can have as Insert statement, Update Statement or Both. If you are using a "select" statement then how can you achieve UPSERT mode ??
Thanx and Regards,
ETL User
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

Quite. I also don't understand why there is a "select" statement where there should be an "insert" or "update" statement.

I'm waiting for IBM to implement "merge" in DataStage, although that would complicate the UI as you need to tick two lists of columns - one set of "key" columns and one set of "when matched" columns, and there isn't a convenient place to put the second tickbox list.
Phil Hibbs | Capgemini
Technical Consultant
rohitagarwal15
Participant
Posts: 102
Joined: Thu Sep 17, 2009 1:23 am

Oracle UPSERT

Post by rohitagarwal15 »

As in previous posts also it has been asked regarding your select statement, you can have a userdefined update or insert statement or automatically also you can have update and insert statement.
Rohit
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I was being somewhat tongue-in-cheek with my answer, just wanted to point out the improper use of the word 'select' rather than insert or update in the DML.

I vaguely recall some stage (you've never stated which Oracle stage we're discussing) not having an "update" mode. You could insert or you could upsert but if you wanted a simple update you had to choose a user-defined upsert of update then insert and replace the insert with another copy of the update to satistfy the stage and ensure that no inserts could occur. That would be the only time you'd do something odd like that, in my humble opinion.

Haven't touched DataStage in going on three years so my memory might be a little off but that's what I recall. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Post by ssreeni3 »

Hi Experts,

Thanks for your inputs and valuble suggestions and openions.


Thnaks,
Sreeni
Post Reply