There are a lot of cases when you need to execute a Job by changing some of its parameters.
1. In short
For exemple, you have a Job that imports an Excel file into a database, but the filename is not the same from one month to another.
This Job is launched from the Client application by an user in your company. He obviously cannot edit your Job, but he can change the dynamic parameters.
The simplest exemple would be :
MyImportTable:SELECT * FROM {?1}.XLSX
It means that the {?1} script will be replaced by the first dynamic parameter : your user is now able to choose any filename without manipulating the Job (and, in this case, the associated query)
2. The power of the Dynamic Parameters
There are many things you can do with Dynamic Parameters

There are 3 available features :
- Static strings : you can write anything as a parameter (ex : MyString)
- Dynamic script : you have access to a list of keywords that will be automatically replaced (ex : %DD-%MM-%YYYY)
- Pre-Job Command result : you can configure a Job to run a command before its execution. The returned value of that command can be used as a dynamic parameter (ex : %CS1)
2.1. Static Strings
This is especially useful when you need to add an optional column in the Source data.
- Exemple :




2.2. Keywords
This is especially useful when you need to manipulate dynamic dates in your Job.

They can also be concatenated in the way you want !
- Exemple :

It means that you won’t need to change the parameter everytime you run the Job.


2.3. Pre-Job Command result
This is especially useful to filter a query in a “Database to Mail” scenario.
- Exemple :

Hint : Setting a pre-command is optional and can be defined on the “Source” tab.

– If the Source is an SQL database, the accepted inputs are SQL commands.
– If the Source is a file, any Windows Shell commands are accepted.

In that case, {?1} will be replaced by the result from :
SELECT MAX(id_sample) FROM sample_table_3;
