Teradata SQL Statements
Teradata SQL statements define and manipulate the data stored in Teradata Database.
FastExport supports a subset of Teradata SQL statements. As a result, other utilities do not have to be invoked to perform routine database maintenance functions before executing FastExport utility tasks. For example, the supported Teradata SQL statements can be used to:
Note: The following restrictions apply to Teradata SQL statements in FastExport job scripts:
Teradata SQL statements supported by Teradata FastExport are listed in Table 3. To use other Teradata SQL statements, exit FastExport and enter them from another application, such as Basic Teradata Query (BTEQ).
Teradata SQL Statement |
Function |
ALTER TABLE |
Changes the column configuration or options of an existing table |
CHECKPOINT |
Adds a checkpoint entry to a journal table |
COLLECT STATISTICS |
Collects statistical data for one or more columns of a table |
COMMENT |
Stores or retrieves comment string associated with a database object |
CREATE DATABASE |
Creates a new database, macro, table, or view |
DATABASE |
Specifies a new default database for the current session |
DELETE |
Removes rows from a table |
DELETE DATABASE |
Removes all tables, views, and macros from a database |
DROP DATABASE |
Drops the definition for an empty database from the Data Dictionary |
DROP TABLE |
Removes a table from Teradata Database |
GIVE |
Transfers ownership of a database to another user |
GRANT |
Grants privileges to a database object |
INSERT |
Inserts new rows to a table |
MODIFY DATABASE |
Changes the options of an existing database |
RENAME |
Changes the name of an existing table, view, or macro |
REPLACE MACRO REPLACE VIEW |
Redefines an existing macro or view |
REVOKE |
Rescinds privileges to a database object |
SET QUERY_BAND |
Allows a set of name‑value pairs to be defined by the user and/or middle tier application so they can be customized to each application’s unique needs at the session level. Note: Only SET QUERY_BAND...FOR SESSION is valid. Although Teradata Database accepts the SET QUERY_BAND...FOR TRANSACTION, Teradata FastExport rejects it, displays an error message and terminates. |
SET SESSION COLLATION |
Overrides the collation specification for the current session |
UPDATE |
Changes the column values of an existing row in a table. |
DML VALIDTIME qualifier and NONTEMPORAL Semantics are now supported for INSERT, DELETE, UPDATE and ALTER TABLE commands.
For syntax and a complete description of each Teradata SQL statement, see SQL Data Definition Language (B035‑1144) and SQL Data Manipulation Language (B035‑1146).