17.10 - ALTER TABLE Syntax (Temporal Form) - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Temporal Table Support

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1182-171K
Language
English (United States)
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 ]
]