Passing Values to a After-SQL.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Barny
Participant
Posts: 2
Joined: Thu Nov 30, 2006 1:56 am

Passing Values to a After-SQL.

Post 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
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post 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...
Regards,
Balaji.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Passing Values to a After-SQL.

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Barny
Participant
Posts: 2
Joined: Thu Nov 30, 2006 1:56 am

Post 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
Post Reply