USING Examples | SQL Statements | Teradata Vantage - Example: USING Request Modifier - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

In this example, the USING request modifier establishes three variable parameters whose constant values are used both for data input and as WHERE clause predicates in a multistatement request:

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

     USING (var_1 CHARACTER, var_2 CHARACTER, var_3 CHARACTER)
     INSERT INTO testtabu (c1) VALUES (:var_1)
    ;INSERT INTO testtabu (c1) VALUES (:var_2)
    ;INSERT INTO testtabu (c1) VALUES (:var_3)
    ;UPDATE testtabu
       SET c2 = c1 + 1
       WHERE c1 = :var_1
    ;UPDATE testtabu
       SET c2 = c1 + 1
       WHERE c1 = :var_2
    ;UPDATE testtabu
       SET c2 = c1 + 1
       WHERE c1 = :var_3;