Example: USING Request Modifier Reads Character Strings - 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-10-04
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantageā„¢

In this example, the USING request modifier defines a variable parameter for use with an explicit transaction that reads character strings from a disk file and inserts them in signed zoned decimal format.

The USING request modifier precedes the BEGIN TRANSACTION statement, while the BEGIN TRANSACTION statement and the request associated with the USING clause are entered as one multistatement request.

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

     USING (zonedec CHARACTER(4))
     BEGIN TRANSACTION
    ;INSERT INTO dectest (colz = :zonedec (DECIMAL(4),
     FORMAT '9999S')) ;

     USING (zonedec CHARACTER(4))
     INSERT INTO Dectest
        (colz = :zonedec (DECIMAL(4), FORMAT '9999S')) ;

     USING (zonedec CHARACTER(4))
     INSERT INTO Dectest
        (colz = :zonedec (DECIMAL(4), FORMAT '9999S')) ;
     END TRANSACTION;

In BTEQ applications, you can combine USING request modifiers with the .REPEAT command to perform multiple insertions automatically.