CREATE TABLE Examples | Teradata Vantage - Example: Creating a Simple Queue Table - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

This example creates a simple queue table.

The first column defined for the table is the Query Insertion Timestamp (QITS) column. This is mandatory for all queue tables.

The QITS column must be defined with a timestamp data type with exactly the same precision and default value as specified in the example. You do not need to specify a precision for the TIMESTAMP data type specification because it defaults to 6 when no precision is specified. You cannot explicitly specify a precision other than 6 for the timestamp. This is mandatory for queue tables.

The QITS column is not the (nonunique) primary index for the table.

       CREATE SET TABLE qtbl_1, QUEUE, FALLBACK, 
       NO BEFORE JOURNAL,
       NO AFTER JOURNAL (
        col_1 TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
        col_2 INTEGER,
        col_3 INTEGER)
       PRIMARY INDEX (col_2, col_3);