16.10 - SelectStmt - Parallel Transporter

Teradata Parallel Transporter Reference

Product
Parallel Transporter
Release Number
16.10
Published
July 2017
Content Type
Programming Reference
Publication ID
B035-2436-077K
Language
English (United States)

SelectStmt (SELECT statement) is the required attribute that the Export operator uses to perform data selection from Teradata Database tables. Multiple parallel instances of the Export operator and multiple sessions within each instance can improve the performance of an export.

A Select request within an Export script can have multiple SELECT statements. A SELECT statement can be optionally preceded by a LOCKING modifier.

However, Export SELECT requests cannot:

  • Specify a USING modifier.
  • Access non-data tables, such as SELECT DATE or SELECT USER.
  • Be satisfied by one or two AMPs, such as SELECT statement which accesses rows based on the primary index or unique secondary index of a table.
  • Contain character large object (CLOB) or binary large object (BLOB) data types.
  • Contain JSON (JavaScript Object Notation) data type.
  • Contain XML data type.

The following table describes types of Select requests.

SELECT Requests 
Type of Select Request Result
Contains multiple SELECT statements The Teradata Database might execute the requests in parallel, but responses are still returned in the order of the requests, for the first statement first, then for the second, and so on.

If the structure of response rows differs, an error results and the job terminates.

Uses a LOCKING modifier The specified lock remains in effect during the execution of all statements within the request that contains the modifier. The Teradata Database does the following:
  • Implements all resource locks for the entire request before executing any of the statements in the request.
  • Maintains the locks until all of the response data for the request is moved to spool tables.

Following is a valid SELECT request using the LOCKING modifier:

LOCKING TABLE MYTABLE FOR ACCESS SELECT COL1, COL2 FROM MYTABLE;

Note that the LOCKING modifier can precede the SELECT statement.

Uses an ORDER BY clause You can specify one or multiple Export instances.

If you specify multiple instances, only instance 1 will connect sessions to preserve the exported rows in order. The other instances will not connect any sessions and will not export any data.

Following is a valid ORDER BY clause:

SELECT COL1, COL2 FROM MYTABLE ORDER BY COL1;