Is it possible to pass schema definition and sql statement in job variables file or command line parameters? %INCLUDE needs exact filename to be mentioned for schema definition which makes the tpt script for one particular extract. We are working on a generic script for 100+ tables so that we can pass the schema and sql in jv file along with instances.
DEFINE SCHEMA SOCPARC_SUBSET_PP
VARCHAR SelectStmt = @SQL
Job Variable script:
Symbol substitution in TPT is exactly that. A "substitution".
It is not "substitution and execute".
Thus, having "cat" in the string will not actually execute the "cat" command.
You can do:
and then in the job variable file, define schema_file_name as xyz.txt.
For the SelectStmt, no the job variable file must have the actual SELECT statement assigned to the job variable named SQL.
Or, on the command line, you can use the -u command line option and assign SQL=SELECT . . . .;
Thanks for the inputs on this. We were able to pass the values having a shell wrapper around the actual tbuild command and also schema file as you mentioned. We can use similar approach for INSERT as well.
tbuild -f tpt_script -u "sql='$sql' schema='$schema'"