Legacy INSERT Examples | Teradata Vantage - 17.10 - Examples: Legacy INSERT Examples - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1208-171K
Language
English (United States)

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');