Configuring a Query Variable for Job Executor
Note: Ensure you have the Spectrum Job Executor downloaded to your server.
-
Create a text file that defines the default values of the variables included in
the SQL query of the Read From DB stage of the job.
To assign a column name
AGEas the default value to a variablecondition1, create a text file, say variables.txt, and include the below line in the file:
To assign a constant value, say 20, as the default value to a variablecondition1=AGEcondition1, include the below line in the file:condition1=20 -
While running the job using the Job Executor on the command prompt, use the
argument
-ofollowed by the path to the created text file.For example, to run the jobReadCustomerDataJob, for which the default values of its variables have been defined in the text file variables.txt, run the below command on a command prompt:java -jar jobexecutor.jar -h "localhost" -u "admin" -p "admin" -s "8080" -j "ReadCustomerDataJob" -o "variables.txt"
On running the job using the Job Executor, the customized query is used to fetch the required data.
Note: For instructions and command-line syntax, see Running a Job in the Spectrum Dataflow
Designer Guide.