Page 1 of 1

Add a single value into all rows of a job

Posted: Wed Apr 26, 2017 6:27 am
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

Posted: Wed Apr 26, 2017 6:34 am
by chulett
Lookup comes to mind.

And welcome. :wink:

Posted: Wed Apr 26, 2017 6:37 am
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?

Posted: Wed Apr 26, 2017 7:02 am
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.