Page 1 of 1

launch the same job with different parameters

Posted: Fri Jan 05, 2007 9:18 am
by kjaouhari
Hi guys !

Can I launch the same job with different parameters in a job sequence ?
the objective of the job is to check number of rows in tables. I have to check several tables.
My idea is to create a list of all parameters with the tables names and then the sequencer start the first time with table1 then the second time with table2 etc ...

The result is a table like this :
table_name|rows
table1 | 12
table2 | 456

I already have a script can launch a job several times with different parameters but I want to know if it's possible by sequencer.

Thanks and good week end !

Posted: Fri Jan 05, 2007 9:20 am
by chulett
Sure... just don't run them at the same time unless it is a multi-instance job. Drag the job onto the Sequence job canvas several times, link them together in a serial fashion and then tweak the parameters as needed. Easy Peasy. :wink:

Posted: Fri Jan 05, 2007 9:25 am
by wnogalski
If it's a fixed list of tables You can hard-code the tablenames in the sequence by setting the job's parameter.
If it should by dynamic (the table list changes) then store the list of tables f.e. in a sequential file and do the table row counts in a loop for each record in the sequential file.

Posted: Fri Jan 05, 2007 10:42 am
by jhmckeever
Also bear in mind it might be possible (depending upon your database configuration) to just pull the DBMS metadata in a single query. E.g. in Oracle:

Code: Select all

SELECT
   table_name, num_rows 
FROM
   tabs
WHERE
   table_name IN ('table1', 'table2', etc.);
HTH,
J.