15.00 - Data Type and Attribute Definitions - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

Data Type and Attribute Definitions

The data type defined for a column can be changed only if the new type does not require a change to the existing data. The rules for changing the data type of a column are listed in “Rules for Changing Column Data Types” on page 75. Also see “Procedure to Change Column Data Types” on page 80.

For an existing column, the following rules are true for data types and attributes with the exception of LOB data types.

You can specify either of the following.

  • FORMAT, TITLE, DEFAULT, or WITH DEFAULT phrases.
  • Changes in data type attributes or in data types in cases where the change does not require rewriting existing rows.
  • The following table provides examples of valid and non-valid type and attribute definition changes.

     

    Changing this form …

    TO this form …

    IS …

    CASESPECIFIC

    NOT CASESPECIFIC

    valid

    NOT CASESPECIFIC

    CASESPECIFIC

    valid

    CASESPECIFIC

    UPPERCASE

    not valid

     

    VARCHAR(6)

    VARCHAR(12)

    valid

    VARCHAR(12)

    VARCHAR(6)

    not valid

    For BLOB and CLOB data types, you can only alter the following column attributes.

  • NULL
  • NOT NULL
  • TITLE
  • FORMAT
  • No other data type attributes are permitted for BLOB or CLOB data.

    You cannot specify a character data set of KANJI1 for CHARACTER, VARCHAR, or CLOB data types. Otherwise, Teradata Database aborts the request and returns an error to the requestor.