INSERT into a PTI Table Example | Teradata Vantage - 17.10 - Examples: INSERT into a PTI Table - 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)

Table and Data Definition for INSERT Examples

Below is the table definition for the nonsequenced table used in the following examples.

CREATE TABLE ocean_buoy_no_seq (buoyid INT, temperature INT)
PRIMARY TIME INDEX(TIMESTAMP(6), HOURS(1), COLUMNS(buoyid), NONSEQUENCED);

Following is the table definition displayed by the SHOW TABLE statement.

SHOW TABLE ocean_buoy_no_seq;
  
CREATE SET TABLE my_db.ocean_buoy_no_seq, NO FALLBACK,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO,
     MAP = TD_MAP1
     (
      TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
      TD_TIMECODE TIMESTAMP(6) NOT NULL GENERATED TIMECOLUMN,
      buoyid INTEGER,
      temperature INTEGER)
PRIMARY TIME INDEX (TIMESTAMP(6), DATE '1970-01-01', HOURS(1), COLUMNS(buoyid), NONSEQUENCED);

Below is the table definition for the sequenced table used in the following examples.

CREATE TABLE ocean_buoy_seq (buoyid INT, temperature INT)
PRIMARY TIME INDEX(TIMESTAMP(6), DATE '2016-01-01', HOURS(1), COLUMNS(buoyid), SEQUENCED);

Following is the table definition displayed by the SHOW TABLE statement.

SHOW TABLE ocean_buoy_seq;

CREATE SET TABLE my_db.ocean_buoy_seq, NO FALLBACK,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO,
     MAP = TD_MAP1
     (
      TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
      TD_TIMECODE TIMESTAMP(6) NOT NULL GENERATED TIMECOLUMN,
      TD_SEQNO INT NOT NULL GENERATED TIMECOLUMN,
      buoyid INTEGER,
      temperature INTEGER)
PRIMARY TIME INDEX (TIMESTAMP(6), DATE '2016-01-01', HOURS(1), COLUMNS(buoyid), SEQUENCED(20000));