Teradata SQL Statements - FastExport

Teradata FastExport Reference

Product
FastExport
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
dita:id
B035-2410
lifecycle
previous
Product Category
Teradata Tools and Utilities

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:

  • Create or modify the table to export from
  • Establish a database as an explicit table‑name qualifier
  • Add checkpoint specifications to a journal table
  • Note: The following restrictions apply to Teradata SQL statements in FastExport job scripts:

  • FastExport supports only the Teradata SQL statements listed in Table 3.
  • Except for the SELECT statement, the supported Teradata SQL statements must appear either before or after an export task specification. They cannot appear between the BEGIN EXPORT and the END EXPORT commands of an export task.
  • The SELECT statement is supported only within an export task specification. It must appear after the BEGIN EXPORT command and before the END EXPORT command of an export task.
  • 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).

     

    Table 3: Supported Teradata SQL Statements in FastExport 

    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
    CREATE MACRO
    CREATE TABLE
    CREATE VIEW

    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
                ...FOR SESSION

    Allows a set of namevalue 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).