Page 1 of 1

Pass values dynamically to SQL code in passive(database)stg.

Posted: Tue Mar 14, 2006 2:58 pm
by rajeevs
Could somebody please let me know how to pass a value to a SQL in a passive stage.

Consider i have a ODBC stage and am connecting to a SQL server database. The scenario here is to use a between clause (or) a < > in a sql statement. This value that i would be passing would be dynamic..

Any suggestions would be appreciated !!

RS

Posted: Tue Mar 14, 2006 3:11 pm
by kcbland
How about a job parameter? Such as

Code: Select all

table.datecol >= '#YourDateParameter#'

Posted: Tue Mar 14, 2006 3:23 pm
by rajeevs
kcbland wrote:How about a job parameter? Such as

Code: Select all

table.datecol >= '#YourDateParameter#'
...
For a Server job running on windows OS - How do i pass the #dateparemeter# to the SQL stmt ?? Kindly advise..

Posted: Tue Mar 14, 2006 3:36 pm
by ssgrpid
You have to pass the value to the job parameter from the sequencer level.

If dynamic value can generated at the sequencer level, like reading from a file, you can use the execute command activity.

If the value has to be generated using some transformation, you can do that in a seperate job and assign the value to user status. This value can be caught at the sequencer level and can again be passed as a parameter to this job.

Posted: Tue Mar 14, 2006 3:59 pm
by kcbland
Learn about job parameters, use your DS Designer manual for more information. They are the mechanism for feeding dynamic runtime control values to processes from the command line or the controlling processes (Batch, Sequence, custom job control).