Page 1 of 1

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

Posted: Thu Jul 19, 2007 10:14 am
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.

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

Posted: Thu Jul 19, 2007 10:25 am
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

Posted: Thu Jul 19, 2007 1:32 pm
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?

Posted: Thu Jul 19, 2007 1:39 pm
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.