16.20 - UPDATE - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ Time Series Tables and Operations

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1208-162K
Language
English (United States)

You cannot reference the system generated TD_TIMEBUCKET column in an UPDATE statement, including referring to the TD_TIMEBUCKET column in the WHERE clause of an UPDATE statement. For complete information about the UPDATE statement, see Teradata Vantage™ SQL Data Manipulation Language , B035-1146 .

Example: UPDATE Rows in a PTI Table

The table definition for the sequenced PTI table ocean_buoy includes a time zero specification of January 1, 2012, DATE '2012-01-01', and a one hour time bucket, HOURS(1):
CREATE TABLE ocean_buoy(buoyid INT, temperature INT)
PRIMARY TIME INDEX(TIMESTAMP(6), DATE '2012-01-01', HOURS(1), COLUMNS(buoyid), SEQUENCED);
This example updates the sequenced PTI table ocean_buoy to set TD_SEQNO to 10 for the row that matches the specified timestamp value and buoy ID.
UPDATE ocean_buoy SET TD_SEQNO = 10
WHERE TD_TIMECODE = TIMESTAMP '2014-01-02 08:30:00' AND
      buoyid = 40;
This example returns an error because you cannot update the system generated TD_TIMEBUCKET column.
UPDATE ocean_buoy SET TD_TIMEBUCKET = 10
WHERE TD_TIMECODE = TIMESTAMP '2014-01-02 08:30:00' AND
      buoyid = 40;