Job variables are often used in place of attribute values and other specifications in a job script. Teradata PT provides two tbuild command options for assigning values to job variables on the command line. Values assigned to job variables through a command line option are in force only for the job being submitted.
-u Command Option Job Variable Assignments
The tbuild -u option allows you to assign values to one or more job variables on the command line. The set of assignments are enclosed in double quotes ("). If more than one assignment is made, they are separated by commas.
For example, if the job script contains the following attribute list:
[ATTRIBUTES ( VARCHAR TdpId = @MyTpdId, VARCHAR UserName = @MyUserName, VARCHAR UserPassword = @MyUserPassword );
You can assign values to the job variables “MyTdpId”, “MyUserName”, and “MyUserPassword” as follows:
tbuild -f weekly_update.txt -u "MyTdpId = 'database1', MyUserName = 'johndoe', MyUserPassword = 'johndoe'"
Values assigned to job variables on the command line take precedence over values assigned to the same variables by all other supported methods of job variable assignment.
-v Command Option Job Variables File
The tbuild -v option allows you to execute job variable assignments that are stored in a local job variables file. For example, the local job variables file jobvars.txt would contain:
MyTdpId ='database1', MyUserName ='johndoe', MyUserPassword ='johndoe'
The associated tbuild command would be:
tbuild -f weekly_update.txt -v jobvars.txt
A value assigned to a job variable from a local job variables file takes precedence over a value assigned to the same variable from any other source, except through the -u option. For setup details, see Setting Up the Job Variables Files.