Add a single value into all rows of a job

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
Nniol
Participant
Posts: 2
Joined: Wed Apr 26, 2017 6:20 am

Add a single value into all rows of a job

Post by Nniol »

Hi,

I have a key value which I am loading in from a database (not a problem), there is just one value in one row here.

I now have an input set of data (currently in XML) which I am parsing into a column structure using Hierarchical Stage. This also works fine.

What I want to do is add the single value I load from the database into each row generated by the hierarchical stage. I can do this in the hierarchical stage, before or afterwards.

The final output will be input into a database table.

So how do I add this single value into every row which is input as XML?

Many thanks

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

Post by chulett »

Lookup comes to mind.

And welcome. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Nniol
Participant
Posts: 2
Joined: Wed Apr 26, 2017 6:20 am

Post by Nniol »

Hi, but would lookup supply the same value to every row?

Ok, it would, I would need to have some kind of key value in the input row say a constant "1", and then just insert this constant value in the output from the database read, giving me a row of 1, [input value].

I would then join on the 1's (so to speak) and populate every value in the input set.


This makes sense?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why yes, yes it does. 8)

You could "insert this constant" as you noted or I believe (it's been awhile now) you could simply hardcode the key value inside the lookup.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply