Type 1: Parameterized Import - Teradata SQL Assistant

Teradata® SQL Assistant for Windows User Guide

Product
Teradata SQL Assistant
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2020-01-03
dita:mapPath
gfk1537201040714.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2430
Product Category
Teradata Tools and Utilities

This form applies to CALL, EXECUTE, SELECT, INSERT, UPDATE, and DELETE statements only (with Microsoft Access, this form is used for INSERT only.) The parameter markers can only be used in place of data values and must not be enclosed in quotes.

There are four types of parameter markers in this case:
  • ? – The data for this parameter is read from the Import file. It is always a character string, and converts to a numeric value if necessary.
  • ?? – The data for this parameter is read from the Import file. It should contain a Hexadecimal string which can contain dashes between each byte value.

    For example: 414B43 or 41-4B-43.

  • ?B – The data for this parameter resides in a file that is in the same directory as the Import file. The import file contains only the name of the file to be imported. The contents of the file are loaded as a binary image.
  • ?C – The data for this parameter resides in a file that is in the same directory as the import file. The import file contains only the name of the file to be imported. Use this marker to load a text file into a CHAR or CLOB column.

For example:

Insert Into TestTbl Values (?, ?, , 'Const', ??, ?B, ?C)
In the example above:
  • The table must have a total of seven columns
  • A NULL character is inserted in column 3 for all rows
  • The word 'Const' is inserted in column 4 for all rows
  • The ?, ??, ?B, ?C characters are the parameter markers
  • The import file must have five data values per record
  • The 3rd parameter must be a hexadecimal string
  • The 4th parameter must be the name of a binary data file in the same directory
  • The 5th parameter must be the name of a text file in the same directory