can I refer to a stage variable in an after stage SQL??

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
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

can I refer to a stage variable in an after stage SQL??

Post by nsm »

My Target is an UDB table and I wanted to run a SQL using the stage variable from the transformer stage to update another control table.

Actually I need to update the control table only once(I can do at the last row) ..I am trying ways to avoid Aggregator Stage.

please help.
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Re: can I refer to a stage variable in an after stage SQL??

Post by mctny »

nsm wrote:My Target is an UDB table and I wanted to run a SQL using the stage variable from the transformer stage to update another control table.
No, you cannot refer a stage variable outside of the current transformer. you can write the value of that stage variable in a flat file or an hash file and then use it in the SQL in a database stage
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Post by nsm »

Thanks mctny..

I need to update the control table when I am at the last record..can we achieve this with in the same transformer stage?
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Post by mctny »

if you really want to use that stage variable in an SQL, you might be able to, (depending on the SQL you are trying to execute,) :

try to convert the sql into routine or function or implemet inside the transformer with the help of transformer functions, new stage variables.
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
Post Reply