ALTER TABLE Syntax (Temporal Form) - Analytics Database - Teradata Vantage

Temporal Table Support

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
eud1628112402879.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
fif1472244754791
lifecycle
latest
Product Category
Teradata Vantage™
Teradata Vantage™ - Temporal Table Support describes syntax that is especially relevant to temporal tables. Syntax that is not required, or that is not otherwise specific to temporal tables is generally not shown in this document. For additional syntax, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144 , Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 , and Teradata Vantage™ - SQL Data Control Language, B035-1149.
[NONTEMPORAL] ALTER TABLE
  [ database_name. | user_name. ] table_name
  [, alter_table_option ] [,...]
  [ other_alter_table_option ] [,...] [;]

For descriptions of standard data types, column attributes, and modifications relating to indexes, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.

other_alter_table_option
{ column_change |

  table_level_constraint_change |

  ADD NORMALIZE [ ALL BUT ( ignored_column_list ) ]
    ON normalize_column [ ON OVERLAPS [ OR MEETS ] ] |

  DROP NORMALIZE
}
column_change
{ ADD column_name {
    data_type [ column_attributes ] |
    column_attributes |
    column_constraint_attribute |
    temporal_column
  } |

  DROP column_name [IDENTITY] [ WITHOUT DELETE ] |

  RENAME old_column_name [AS] TO new_column_name |

  derived_period_column
}
table_level_constraint_change
{ table_level_reference_definition |

  ADD [ CONSTRAINT name ] [ time_option ] CHECK ( boolean_condition ) |

  DROP [ CONSTRAINT name ] CHECK |

  MODIFY [ CONSTRAINT name ] [ time_option ] CHECK ( boolean_condition ) |

  table_level_unique_definition
}
column_constraint_attribute
[ CONSTRAINT name ] {

    [ time_option ] { CHECK ( boolean_condition ) | UNIQUE | PRIMARY KEY } |

    [ RI_time_option ] REFERENCES WITH NO CHECK OPTION
      table_name [ ( column_name ) ]
  }
temporal_column
{ { PERIOD (DATE) | PERIOD ( [ ( precision ) ] [ WITH TIME ZONE ] ) }
    [ NOT NULL ] [AS] VALIDTIME |

  PERIOD (TIMESTAMP(6) WITH TIME ZONE) NOT NULL [AS] TRANSACTIONTIME
}
derived_period_column
{ ADD PERIOD FOR derived_column ( begin_column, end_column )
  [ [AS] { VALIDTIME | TRANSACTIONTIME } ] |

  DROP [ PERIOD FOR ] derived_column
}
table_level_reference_definition
{ { ADD [ CONSTRAINT name ] | DROP }
    [ RI_time_option ] 
    FOREIGN KEY ( column_name [,...] )
    REFERENCES WITH NO CHECK OPTION table_name [ ( column_name [,...] ) ] |

    DROP INCONSISTENT REFERENCES
  }
time_option
CURRENT TRANSACTIONTIME
  [ AND [ CURRENT | SEQUENCED | NONSEQUENCED ] VALIDTIME ]
table_level_unique_definition
{ DROP CONSTRAINT name |

  ADD [ CONSTRAINT name ] time_option
    { UNIQUE | PRIMARY KEY } ( column_name [,...] )
}
RI_time_option
{ CURRENT | SEQUENCED | NONSEQUENCED } TRANSACTIONTIME
  [ AND [ CURRENT | SEQUENCED | NONSEQUENCED ] VALIDTIME ]
]