Page 1 of 1

Passing Values to a After-SQL.

Posted: Thu Nov 30, 2006 2:53 am
by Barny
Hi there,

i am new to this Forum and first want to say "Hello" to every DataStage User...

My Question is:

I have a Transformer Stage who writes Rows into a table (lets call LERBINFO). In another table (lets call LOGINFO) i want to log the information, how many rows where written.

So i have the information @INROWNUM from the Transformer Stage and want to write this information into the table LOGINFO in the After-SQL.
(I assume, that the After-SQL ist called ONCE every run?

But things like: INSERT INTO LOGINFO("LERBINFO", #@INROWNUM#) dosn't work. It only works with Job Parameters.

Any Idea?

Thanks...
Barny

Posted: Thu Nov 30, 2006 3:32 am
by BalageBaju
Hi Barny,

To get the number of rows passed in target we can go for the function
"DSGetLinkInfo" instead of @INROWCOUNT.

Also you can get all details about your job such as Jobname, Jobstarttime, Jobendtime, tiem elapsed etc., by using the DSGetJob functions and you can store those details in to log_detail if necessary.

Hope this may help you...

Re: Passing Values to a After-SQL.

Posted: Thu Nov 30, 2006 8:06 am
by chulett
Barny wrote:So i have the information @INROWNUM from the Transformer Stage and want to write this information into the table LOGINFO in the After-SQL.
(I assume, that the After-SQL ist called ONCE every run?
Yes, you are correct that it is only called once, but that's not where you want to do this. :wink:

Split another link off your Transformer and send a value to the Aggregator stage - doesn't really matter what that value is as long as it's not NULL. Then tell the Aggregator to Count them and then send that counted result (the same as your MAX(@OUTROWNUM)) to another stage that inserts the value into the LOGINFO table.

Posted: Fri Dec 01, 2006 5:38 am
by Barny
Hi BalageBaju, hi chulett,

i now realized the version from chulett, and for the moment i am happy with the solution. For the future i take a look at the ETLStats-Tool.

Thanks for your Support...
Barny