The following table describes the things to consider when using the DEFINE SCHEMA statement.
Topic | Description |
---|---|
Use of UNICODE Affects Column Width Requirements | Teradata PT can automatically adjust the column widths when explicitly using UTF-8 and UTF-16 character sets with the ADJUST UNICODE keywords. See syntax diagram in DEFINE SCHEMA for correct syntax of the keyword. If the USING CHARACTER SET UTF8 or UTF16 specifier and the ADJUST UNICODE specifier are both present in the script, column widths will automatically adjusted for Unicode type used. Affected Datatypes are: CHAR, VARCHAR, CLOB and JSON.
For more information on USING CHARACTER SET specifier details, see Using Extended Character Sets. Alternatively, you may adjust the column widths manually. The rules for adjustments are as follows:
|
Using Default Lengths | Many data types are associated with length specifications lengthBytes or lengthDigits, which may be either optional or required, depending on the data type. Most of these allow for deferral to the default length value, by simply not specifying the length. However, since the default length is often the maximum length, use of the default value could cause a minor degradation in performance. Be sure to specify length values rather than deferring to the default values when maximizing performance is important. |
Specifying ANSI/SQL INTERVAL, TIME, and TIMESTAMP Datatypes | In prior releases, Teradata PT required users to define columns of these types as CHAR columns of the appropriate lengths in Teradata PT schemas, for example, CHAR(8) for a Database TIME(0) column. Starting with Teradata PT Release 12.0, these columns can be defined with their database data type identifiers directly in DEFINE SCHEMA statements. |
Specifying ARRAY Data Types | A column that is defined as an ARRAY data type in a database table must be specified as a VARCHAR data type in the DEFINE SCHEMA statement. The external representation for an ARRAY data type is VARCHAR. For more information, see the Teradata® Parallel Transporter User Guide, B035-2445. |
Specifying USINGEXTENSION | The USINGEXTENSION option can be used to load data into a temporal table using the Teradata PT Update operator. For more information on how to use the USINGEXTENSION option, see Temporal Tables. |