Repository: trafodion Updated Branches: refs/heads/master 9f8fc8e84 -> 20f8240e4
[TRAFODION-3132] Add and Correct Descriptions for *Character String Data Type* in *Trafodion SQL Reference Manual* Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/f72d026a Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/f72d026a Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/f72d026a Branch: refs/heads/master Commit: f72d026a231cbb418bf4334467cff71ba0b5eeb9 Parents: 9e675ff Author: liu.yu <[email protected]> Authored: Mon Jul 9 17:29:19 2018 +0800 Committer: liu.yu <[email protected]> Committed: Mon Jul 9 17:29:19 2018 +0800 ---------------------------------------------------------------------- .../_chapters/sql_language_elements.adoc | 47 ++++++++++---------- 1 file changed, 24 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/f72d026a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---------------------------------------------------------------------- diff --git a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc b/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc index 2704107..43b8b9d 100644 --- a/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc +++ b/docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc @@ -325,14 +325,14 @@ The following table summarizes the {project-name} SQL data types: [cols="14%,14%,24%,24%,24%",options="header"] |=== | Category | Type | SQL Designation | Description | Size or Range^1^ -.8+| Character String Data Type .3+| Fixed-length character | CHAR[ACTER] | Fixed-length character data | 1 to 200000 characters^2^ ^8^ -| NCHAR | Fixed-length character data in predefined national character set | 1 to 200000 bytes^3^ ^7^ ^9^ -| NATIONAL CHAR[ACTER] | Fixed-length character data in predefined national character set | 1 to 200000 bytes^3^ ^7^ ^9^ -.5+| Variable-length character | VARCHAR | Variable-length ASCII character string | 1 to 200000 characters^4^ ^8^ -| VARCHAR2 | Variable-length ASCII character string | 1 to 200000 characters^4^ ^8^ -| CHAR[ACTER] VARYING | Variable-length ASCII character string | 1 to 200000 characters^4^ ^8^ -| NCHAR VARYING | Variable-length ASCII character string | 1 to 200000 bytes^4^ ^7^ ^9^ -| NATIONAL CHAR[ACTER] VARYING | Variable-length ASCII character string | 1 to 200000 characters^4^ ^7^ ^8^ +.8+| Character String Data Type .3+| Fixed-length character | CHAR[ACTER] | Fixed-length character data | 1 to 16,777,216 bytes ^6^ +| NCHAR | Fixed-length character data in predefined national character set | 1 to 16,777,216 bytes^2^ ^5^ ^7^ +| NATIONAL CHAR[ACTER] | Fixed-length character data in predefined national character set | 1 to 16,777,216 bytes^2^ ^5^ ^7^ +.5+| Variable-length character | VARCHAR | Variable-length ASCII character string | 1 to 16,777,216 bytes^3^ ^6^ +| VARCHAR2 | Variable-length ASCII character string | 1 to 16,777,216 bytes^3^ ^6^ +| CHAR[ACTER] VARYING | Variable-length ASCII character string | 1 to 16,777,216 bytes^3^ ^6^ +| NCHAR VARYING | Variable-length ASCII character string | 1 to 16,777,216 bytes^3^ ^5^ ^7^ +| NATIONAL CHAR[ACTER] VARYING | Variable-length ASCII character string | 1 to 16,777,216 bytes^3^ ^5^ ^7^ .6+| Datetime Data Types .6+| Date-Time | | Point in time, using the Gregorian calendar and a 24 hour clock system. The five supported designations are listed below. | YEAR 0001-9999 + MONTH 1-12 + @@ -360,7 +360,7 @@ FRACTION in 4 bytes + | TIMESTAMP | Point in time, no time precision | Format as YYYY-MM-DD HH:MM:SS.FFFFFF; actual database storage size is 11 bytes | TIMESTAMP (with time precision) | Point in time, with time precision | Format as YYYY-MM-DD HH:MM:SS.FFFFFF; actual database storage size is 1 byte | Interval Data Types |Interval | INTERVAL | Duration of time; value is in the YEAR/MONTH range or the DAY/HOUR/MINUTE/YEAR/SECOND/FRACTION range -| YEAR no constraint^5^ + +| YEAR no constraint^4^ + MONTH 0-11 + DAY no constraint + HOUR 0-23 + @@ -396,21 +396,22 @@ length of 8 bytes. * _precision_ specifies the allowed number of decimal digits. -1. The size of a column that allows null values is 2 bytes larger than the size for the defined data type. -2. The maximum row size is 32708 bytes, but the actual row size is less than that because of bytes used by -null indicators, varchar column length indicators, and actual data encoding. -3. Storage size is the same as that required by CHAR data type but store only half as many characters depending -on character set selection. -4. Storage size is reduced by 4 bytes for storage of the varying character length. -5. The maximum number of digits in an INTERVAL value is 18, including the digits in all INTERVAL fields of the value. +1. The size of a column that allows null values is 2 bytes larger than the size for the defined data type. +2. Storage size is the same as that required by CHAR data type but store only half. +3. Storage size is reduced by 4 bytes for storage of the varying character length field. +4. The maximum number of digits in an INTERVAL value is 18, including the digits in all INTERVAL fields of the value. Any INTERVAL field that is a starting field can have up to 18 digits minus the number of other digits in the INTERVAL value. -6. The maximum is 32707 if the national character set was specified at installation time to be ISO88591. -The maximum is 16353 if the national character set was specified at installation time as UTF8. -7. The maximum is 32703 if the national character set was specified at installation time to be ISO88591. -The maximum is 16351 if the national character set was specified at installation time as UTF8. -8. It defaults to 200000 characters and can be declared explicitly by using the TRAF_MAX_CHARACTER_COL_LENGTH CQD. -9. It defaults to 200000 bytes and can be declared explicitly by using the TRAF_MAX_CHARACTER_COL_LENGTH CQD. - +5. The maximum is 16,777,216 bytes whether the national character set was specified at installation time to be ISO88591 or UTF8. +6. The number of characters varies depending on the character set. ++ +[cols="2*^",options="header"] +|=== +| *Character Set* | *Character* +| ISO88581 | 16,777,216, which is divided 16,777,216 by 1 +| UCS2 | 8,388,608, which is divided 16,777,216 by 2 +| UTF8 | 4,194,304, which is divided 16,777,216 by 4 +|=== +7. The number of characters is 8,388,608 (UCS2). <<< [[comparable_and_compatible_data_types]]
