Example: USING Request Modifier with Variables - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

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.