问题
I just started using Datastage (version 11.5) and I am trying to assign the value of a simple SQL query (select max(date_col) from Table) into a Job Parameter so that I can use it as a part of a file produced from the job.
Can anyone point out a simple approach to this, since I am rather lost on how to include SQL queries in parameter values.
Thanks in advance.
回答1:
There are some options to do this. The one I recommend is:
- write the result of you query into a sequential file
- Use a Execute Command stage (in a Sequence) to read the file
- use it in one of the following Job Activity stages (as job parameter)
An alternative could be the use of Parameter Sets with value files. These value files are real files in the OS and their structure is simple so these could be written by the DataStage job. In this case it cannot be used for Conditions in the Sequence.
来源:https://stackoverflow.com/questions/45348780/assigning-an-sql-result-to-a-job-parameter-in-datastage