Page 1 of 1
Passing Set of values from a data base table to Sequence Job
Posted: Tue Sep 30, 2008 3:48 am
by sjordery
Hi ,
I want to pass 4 distinct values from a data base table to a Sequence job.
I have defined 4 parameters to catch the values.
Is there any method to read and pass it to the job parameters.
Thanks in Advance!
Posted: Tue Sep 30, 2008 4:02 am
by ray.wurlod
Lots of ways. My preferred way is as follows.
Create a server job to catch all four in a single string and load that into the job's user status area, and read that from the Job activity's $UserStatus variable and parse with Field functions.
Code: Select all
SELECT v1 || ';' || v2 || ';' || v3 || ';' || v4 FROM table WHERE condition ;
(make sure it returns just one row)
Code: Select all
Field(FetchJob.$UserStatus, ";", 1,1)
Posted: Tue Sep 30, 2008 5:14 am
by sjordery
Thanks Ray for your suggestion.
I have some confusion on this could you please explain
1-1st I will read the values from the table using any dabase stage then how to load the string to job's user status area which will be used in another sequence job?
2-Is the Sequence job will depedent on this job?
Thanks,
sjordery.
Posted: Tue Sep 30, 2008 5:58 am
by ray.wurlod
1.
Search - both the DSSetUserStatus routine and an interlude function exist on DSXchange.
2. Yes.
Posted: Mon Oct 06, 2008 5:13 am
by sjordery
Thanks Ray!
I did exactly as mentioned to set the status of the job with a value by invoking a routine which calls DSSetUserStatus function and it worked fine.
If we need to catch more than one value and pass it to set of parameters in a sequence job then ,do we need to design those many jobs or can we do this in the same job.
Regards,
Sjordery.
Posted: Mon Oct 06, 2008 7:25 am
by chulett
Put them in a delimited string and then parse it back into the component pieces after fetching it from the user status area.
Posted: Mon Oct 06, 2008 8:22 am
by ray.wurlod
... which is exactly what I suggested when you asked about four values.
Posted: Mon Oct 06, 2008 8:55 am
by chulett
Why, so you did. I didn't bother to scroll back that far.
![Wink :wink:](./images/smilies/icon_wink.gif)