INSERT into a PTI Table Example | Teradata Vantage - 17.00 - Examples: INSERT into a PTI Table - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-1208-170K

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