Types of Import Operations
There are three types of import operations:
Type 1: Parameterized Import
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:
For example: 414B43 or 41-4B-43.
For example:
Insert Into TestTbl Values (?, ?, , 'Const', ??, ?B, ?C)
In the example above:
Type 2: Direct Substitution
This form applies to all other statements. Parameter markers can be used anywhere in the query. The data values are directly edited into the SQL at the parameter positions. Therefore, some parameter markers might need to be enclosed in quotes.
Create User ? As Perm=0 Password=? Account=’?’
Note: In Direct Substitution, only the “?” parameter is valid.
If an IMPORT
statement returns data, the results are written to a file whose name is formed by
adding ‘.Log’ to the end of the import file name. If this file already exists, its
contents are replaced with new results. A header record containing the first data
value from the corresponding import record is written before each set of returned
data.
Type 3: Batch
This form applies when the following conditions are met:
INSERT
, UPDATE
, or DELETE
statement
If the Batch size is set to one, the Batch import mode is not used. For larger values, the data provider packs the data for the specified number of rows into a batch (as long as it fits into a 64k parcel), and executes one batch at a time.
In general, the larger the batch size, the better the performance. With larger batch sizes:
The Silently discard rows that cause constraint violations option on the Import tab of the Options dialog box can be selected if the data is just a sample, or if loss of duplicates or other rows that cause constraint violations are not a problem. If this option is selected, all errors are ignored and Teradata SQL Assistant reports the number of rows that were imported and the number of rows discarded.