Insert Data into a Sequenced Table Examples | Teradata Vantage - Examples: Inserting Data into a Sequenced Table - Advanced SQL Engine - Teradata Database

Time Series Tables and Operations

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cxa1555383531762.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1208
lifecycle
previous
Product Category
Teradata Vantageā„¢

Examples: INSERT into a Sequenced Table

Following are 5 valid inserts into the table.

INSERT INTO ocean_buoy_seq(TIMESTAMP '2017-01-06 10:32:12', 1, 111, 50);
INSERT INTO ocean_buoy_seq(TIMESTAMP '2017-01-06 10:32:12', 2, 111, 60);
INSERT INTO ocean_buoy_seq(TIMESTAMP '2017-01-06 10:34:09', 1, 111, 70);
INSERT INTO ocean_buoy_seq(TIMESTAMP '2017-01-06 10:32:12', 1, 222, 80);
INSERT INTO ocean_buoy_seq(TIMESTAMP '2017-01-06 10:32:12', 2, 222, 90);

Examples: Invalid INSERT into a Sequenced Table

The following statement returns an error because the insert TD_TIMECODE value precedes the timezero DATE '2016-01-01' in the definition of the table ocean_buoy_seq.

INSERT INTO ocean_buoy_seq(TIMESTAMP '2015-01-01 10:32:12', 1, 111, 60);
This statement returns an error because the TD_SEQNO column value is missing:
INSERT INTO ocean_buoy_seq(TIMESTAMP '2017-01-06 10:32:12.133308', , 444, 50);