Legacy INSERT Examples | Teradata Vantage - Examples: Legacy INSERT Examples - 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: Legacy INSERT

Following are valid inserts that use the legacy column to value mapping syntax.

INSERT INTO ocean_buoy_no_seq (TD_TIMECODE, BUOYID, TEMPERATURE) VALUES (TIMESTAMP '2017-01-06 10:32:12.123456', 111, 50);
INSERT INTO ocean_buoy_no_seq (BUOYID, TEMPERATURE, TD_TIMECODE) VALUES (111, 50, TIMESTAMP '2017-01-06 10:32:12.123455');
INSERT INTO ocean_buoy_no_seq VALUES (TIMESTAMP '2017-01-06 10:39:10.123456', 111, 66);

Examples: Invalid Legacy INSERT

You cannot specify an isolated loading clause with inserts into a PTI table. This statement returns an error.

INSERT WITH CONCURRENT ISOLATED LOADING INTO ocean_buoy_seq VALUES(TIMESTAMP '2017-01-06 10:32:12.133308', 1, 444, 50);

You cannot specify default values for inserts into a PTI table. This statement returns an error.

INSERT INTO ocean_buoy_no_seq DEFAULT VALUES;

You cannot specify the TD_TIMEBUCKET column in inserts for a PTI table. This statement returns an error.

INSERT INTO ocean_buoy_no_seq (TD_TIMEBUCKET, BUOYID, TEMPERATURE, TD_TIMECODE) VALUES (123, 111, 50, TIMESTAMP '2017-01-06 10:32:12.123456');