Page 1 of 1

Creating dynamic table.

Posted: Fri Oct 12, 2007 8:10 am
by UPS
Hi,
Newbie Questions :?:
I am reading sequential files using file pattern & trying to load temp tables for each changing time period(YYMM). I need to pass parameter to Oracle stage to create tables with changing YYMM?

Thanks in Advance.
SP.

Re: Creating dynamic table.

Posted: Fri Oct 12, 2007 1:57 pm
by kris
Have a JOB parameter for the period and use it as part of the table name in the DATABASE stage.

something like
TEMPTABLE_#Param_Period#

Every time you run the job, you will create a new table. But you need to be mindful about the fact that when the period doesn't change, table need to be dropped or handled correctly.

Re: Creating dynamic table.

Posted: Fri Oct 12, 2007 5:37 pm
by UPS
kris wrote:Have a JOB parameter for the period and use it as part of the table name in the DATABASE stage.

something like
TEMPTABLE_#Param_Period#

Every time you run the job, you will create a new table. But you need to be mindful about the fact that when the period doesn't change, table need to be dropped or handled correctly.
The Parameter is a field in the sequential file. How do I pass it to the table name in the same job... If I say #DSLinkname.fieldname# in the table name, job parameter doesn't get resolved. I am using Oracle Enterprise stage with load option.

Thanks
SP

Posted: Fri Oct 12, 2007 8:24 pm
by chulett
You can't. It must be a Job Parameter passed in from another source, like another job or routine. A Sequence job could easily do the trick, read the file to get the parameter value and then pass it to your processing job.

Posted: Sat Oct 13, 2007 9:24 am
by ray.wurlod
Job parameters must be defined in the job properties dialog. Use the fifth tool from the left on the toolbar, or Ctrl-J, to open this dialog.

Re: Creating dynamic table.

Posted: Wed Oct 17, 2007 12:03 am
by anshumangupta1206
[quote="UPS"]

You can pass the seq file value in the DS routine. The routime will set the parameter using 'DSSetParam ' function and call a job 'DSRunJob'.

Thanks.