Example: USING Request Modifier with Variables - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

In this example the USING request modifier defines the variables :emp_name and :emp_number as, a CHARACTER constant and an INTEGER numeric constant, respectively. The USING variables are replaced by values from a client system data record when the system processes the accompanying INSERT request.

     .SET RECORDMODE ON
     .IMPORT DATA FILE = r13sales.dat;

     USING (emp_name   CHARACTER(40),
            emp_number INTEGER)
     INSERT INTO employee (name, empno)
     VALUES (:emp_name, :emp_number);

The INSERT request (in Record Mode on an IBM mainframe) is transmitted to the database with an appended 44-byte data record consisting of a 40-byte EBCDIC character string followed by a 32-bit integer.