Page 1 of 1

Passing parameters to a Email Stage from Table

Posted: Mon Oct 15, 2012 8:08 am
by chillblue
Hi All,

The Email parameters like FROM , TO and Subject will be stored in a table and i need to Read the content from the table and pass the values to the Notification Stage (at the sequence Job level).

How to implement this in DS ?



Thanks
Chillblue

Posted: Mon Oct 15, 2012 9:01 am
by chulett
Use a Server job to capture that information and store it (delimited) in USERSTATUS. The sequence can easily extract it from there and you can use Field() in the paramater assignment to split them back out.

A User Variables stage can also be handy here. If you'd rather not use USERSTATUS then a flat file can be leveraged as well for intermediate storage.

Posted: Mon Oct 15, 2012 2:49 pm
by chillblue
Thanks Lot for your reply.

I cant use a server job so went in for the below approach.


Wrote the parameters to 3 different files. From , To and subject.

Read them separately via command output stage.

passed the parameters to the Email stage.


Thanks.

Posted: Mon Oct 15, 2012 3:04 pm
by ankursaxena.2003
Even if you write a parallel job, you don't need to have 3 stages to read and 3 files.

Read the data from Oracle and write on a single file.
For example,
Test.txt

abc@gmail.com~def@gmail.com~Test Mail

And then read the file using CAT command in unix.
And later using FIELD() in the parameter assignment to split them where '~' will be delimiter.

This way you need

Oracle Extract ----> Execute Stage ------> User Variable Activity ----> Mail Notification

Posted: Mon Oct 15, 2012 3:10 pm
by ankursaxena.2003
You don't even need to put User Variable Activity.
You can directly use $CommandOutput to read the output from cat command.

#ExecCommand.$CommandOutput#

Posted: Mon Oct 15, 2012 3:13 pm
by chulett
Many ways to skin this cat. You could put three records in the file, cat them and then use array notation to get the 1st, 2nd and 3rd values. For example:

ExecCommand.$CommandOutput<2>

would contain the contents of the second record.