Insert Data into a Nonsequenced Table Examples | Teradata Vantage - Examples: Inserting Data into a Nonsequenced Table - Analytics Database - Teradata Vantage

Time Series Tables and Operations

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
2023-10-30
dita:mapPath
tuc1628112453431.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
sfz1493079039055
lifecycle
latest
Product Category
Teradata Vantageā„¢

Examples: INSERT into a Nonsequenced Table

The INSERT values list begins with the TD_TIMECODE column value, then buoyid and temperature. The inserts can be in any order. You do not have to perform the inserts in time sequence order. The system automatically generates a TD_TIMEBUCKET value for each insert row. You do not supply a value for TD_TIMEBUCKET column.

INSERT INTO ocean_buoy_no_seq(TIMESTAMP '2017-01-06 10:32:12.123456', 111, 50);
INSERT INTO ocean_buoy_no_seq(TIMESTAMP '2017-01-06 10:32:12.123456', 111, 60);
INSERT INTO ocean_buoy_no_seq(TIMESTAMP '2017-01-06 10:44:15.123456', 111, 60);
INSERT INTO ocean_buoy_no_seq(TIMESTAMP '2017-01-06 10:39:10.123456', 111, 50);
INSERT INTO ocean_buoy_no_seq(TD_TIMECODE, buoyid, temperature) VALUES (TIMESTAMP '2020-01-06 10:32:12.123456', 111,  50);
INSERT INTO ocean_buoy_no_seq(TD_TIMECODE, buoyid, temperature) VALUES (TIMESTAMP '2020-01-06 10:42:22.123456', 222,  60);
INSERT INTO ocean_buoy_no_seq(TD_TIMECODE, buoyid, temperature) VALUES (TIMESTAMP '2020-01-06 10:40:20.123456', 333,  70);

Examples: Invalid INSERT into a Nonsequenced Table

You cannot insert into the TD_TIMEBUCKET column. The following statements return an error.

INSERT INTO ocean_buoy_no_seq(, TIMESTAMP '2017-01-06 10:32:12.123456', 111, 50);
INSERT INTO ocean_buoy_no_seq(55, TIMESTAMP '2017-01-06 10:32:12.123456', 111, 50);

You cannot use CURRENT_TIMESTAMP as an insert value into the TD_TIMECODE column. The following statement returns an error.

INSERT INTO ocean_buoy_no_seq(CURRENT_TIMESTAMP, 111, 50);

You must specify a value for the TD_TIMECODE column. The following statement returns an error.

INSERT INTO ocean_buoy_no_seq( , 111, 50);