CREATE TABLE Examples | Teradata Vantage - Example: Creating a Simple Queue Table - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
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);