Table Name from selected Column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 132
- Joined: Wed Mar 01, 2006 11:12 pm
- Location: Pune
Table Name from selected Column
I have a table which has columns with table_name and a Flag. I need to fetch the table name with Flag = 'Y' and pass that table name as the table name for the target DB2 stage of my Job. Can any one help me in achieving this
SMB
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not in the same job.
You would need to obtain the table name in an upstream job and store it somewhere.
In the downstream job make the table name in the target stage a job parameter reference.
In the job sequence that runs both of these jobs, read the table name from its stored location to load a value into the job parameter of the downstream job.
Search the forum for methods of temporarily storing and retrieving values in a job sequence.
You would need to obtain the table name in an upstream job and store it somewhere.
In the downstream job make the table name in the target stage a job parameter reference.
In the job sequence that runs both of these jobs, read the table name from its stored location to load a value into the job parameter of the downstream job.
Search the forum for methods of temporarily storing and retrieving values in a job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 252
- Joined: Mon Sep 19, 2005 10:28 pm
- Location: Melbourne, Australia
- Contact:
I don't use DB2, but it should be similar to the Oracle OCI stage.
I believe that what you are trying to do is impossible. It calls for the table name to be dynamically determined at run-time.
The closest you can get to a dynamic table name is to use a Job Parameter (eg. #TABLE_NAME#) in your SQL statement. But then you have to set the value of the parameter, which cannot be done once the job has started.
At best, you could run a job that selected the table name, and then pass it into the next job as a parameter. Search on the following for details of how to pass values between jobs:
- DSSetUserStatus
- $UserStatus
I believe that what you are trying to do is impossible. It calls for the table name to be dynamically determined at run-time.
The closest you can get to a dynamic table name is to use a Job Parameter (eg. #TABLE_NAME#) in your SQL statement. But then you have to set the value of the parameter, which cannot be done once the job has started.
At best, you could run a job that selected the table name, and then pass it into the next job as a parameter. Search on the following for details of how to pass values between jobs:
- DSSetUserStatus
- $UserStatus
Ross Leishman