Table definitions at runtime

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

Table definitions at runtime

Post by brupun »

Can a table definition be passed to a job at runtime? I have a requirement to extract contents from different tables and the client wants me to generalize this process by passing parameters for table name and table definition. I personally think this cannot be done but want some confirmation from the group.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Might be possible through RCP
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The table access stages can work with SELECT * and then use RCP to pass on all columns. But then what do you want to do with those columns? If you are just going to copy everything to a dataset, or pass in a column name as a parameter and check that for a certain value then making generic jobs is quite easy; that is what RCP excels at.
The SQL Select clause can be a parameter which contains your selection criteria, that is easily implemented. But again, what do you want your generic job to actually do?
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

Post by brupun »

I want the generic job to extract data from a table and load into a dataset. Tablename, table definition should be given at runtime. My source is Db2 database table for which I'm using db2 connector. I am going to test RCP method today and see if it fulfills the reuirement. Thanks for your help.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Piece of cake with RCP.

1. Declare your source table to use the parameterised SELECT statement (you don't need to pass in the datatypes of the columns that you are selecting)
2. Do not define ANY column in the output link to this stage, just activate RCP in the tick box.
3. Make this link to go a dataset stage and use your parameter to declare the name and path to the dataset descriptor file.
4. Compile & Run
brupun
Premium Member
Premium Member
Posts: 16
Joined: Thu Jun 14, 2012 10:10 am

Post by brupun »

Thank you! It worked.
Post Reply