Duplicate record insert with other value

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
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Duplicate record insert with other value

Post by devanars »

I have a requirement like
If id=1 and cd=10 then 'a'
If id=1 and cd=10 then 'b'
If id=1 and cd=10 then 'c'
if the same record comes again from source then need to chage the value
target is oracle table.

May i know the logic behind this to do
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sort, generate key change column in Sort stage, use this to flag in Transformer stage when you need to "increment" the value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Post by devanars »

This requirement is not to increment.output is a string value. is there any idea of disign.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use a column generator with list of values.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Note that Ray did not say increment, he said "increment". There's a reason why it was in quotes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Post by devanars »

All records are coming from source no need to generate a column in the middle. the way source records are coming need to insert in target
All three recors are coming from the source with the same value

First record will insert directly with one value
Second record will be duplicate so it is not going to insert directly then need to inset with other value for same target fields.



Please let me know if i am not able to explain properly
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

devanars wrote:... then need to inset with other value for same target fields.
What do you mean by "other value" you can insert "ANY" value or is there specific requirement to insert?
devanars
Premium Member
Premium Member
Posts: 99
Joined: Thu Nov 30, 2006 6:25 pm

Post by devanars »

Yes Specific requirement values are there. sorry for not able to give proper details.
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

hi,
if it is possible to use an oracle enterprise stage,you can give rank() function or row _number() a try.

Regards,
Raja R P
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can "increment" a single character.

Code: Select all

Char(Seq(prevcharacter)+1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply