Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS forUNIX SQL Reference - NCR

NCR Teradata RDBMS forUNIX SQL Reference - NCR, 1997. - 913 p.
Download (direct link): teradataforunix1997.pdf
Previous << 1 .. 36 37 38 39 40 41 < 42 > 43 44 45 46 47 48 .. 241 >> Next


Character Set Character String Conversion Result
KanjiEBCDICa mN<abC>b MN<abc>B
KanjiEUC mna ss2bB ss3cC MNa ss2B ss3C
KanjiShift-JISd mn/abc MN/abc

a. < is Shift-Out, > is Shift-In, bold = double byte

b. cs2

c. cs3

d. / bold-italic = single byte katakana

5-26

Teradata RDBMS for UNIX SQL Reference
Data Definition

CHAR, VARCHAR and LONGVARCHAR Character Data Types

CHAR

VARCHAR(n)

CHAR, VARCHAR and LONGVARCHAR Character Data Types

The CHAR or CHARACTER data type represents a fixed-length character string. The specification of a CHAR data type is:

CHAR (n)

n = 1 to 32000 (number of bytes)

CHARACTER data is stored in extended ASCII for European character support, and extended JIS-x201 for Japanese character support. Character data is allocated in terms of bytes. Except for characters available with Japanese character support (e.g., Kanji), each character requires one byte of storage. Any conversion to or from the client system’s data type is done by the Teradata RDBMS. This data type supports national character sets.

If a value for n is not specified, the default is CHAR(I).

In the following column definitions, the column named Sex is assigned the CHAR data type with a length of one, and the column named Frgn_Lang is assigned the CHAR data type with a length of seven.

Sex CHAR NOT NULL UPPERCASE,

Frgn_Lang CHAR(7) NULL UPPERCASE,

The default display format of CHAR(n) is X(n). For example, X(5), where data ’HELLO’ displays as ’HELLO’.

The VARCHAR(n) data type represents a variable-length character string of length n. The maximum value for n is 32,000 characters. Synonyms for VARCHAR(n) are CHAR VARYING [(n)], and CHARACTER VARYING [(n)].

VARCHAR (n)

I I I I I I I

Two byte length

I I I I I I I

TT

TT

I I I I I I I

n = 1 to 32000 (maximum number of bytes)

FF19A008

Teradata RDBMS for UNIX SQL Reference

5-27
Data Definition

CHAR, VARCHAR and LONGVARCHAR Character Data Types

LONG VARCHAR

VARCHAR data is stored in extended ASCII for European character support, and extended JIS-x0201 for Japanese character support. Character data is allocated in terms of bytes. Except for characters available with Japanese character support (e.g., Kanji), each character requires one byte of storage.

Note: VARCHAR(n) is flagged as not Entry Level ANSI, when the SQL flagger is enabled.

The default display format for VARCHAR(n) is X(n).

For example, X(6) displays data ‘GOOD’ as ‘GOOD ’ with two trailing blanks.

LONG VARCHAR is equivalent to VARCHAR(32000). LONG VARCHAR specifies the longest permissible variable length character string.

LONG VARCHAR

Two byte length

Equivalent to VARCHAR(32000)

LONG VARCHAR data is stored in extended ASCII for European character support, and extended JIS-x0201 for Japanese character support. Character data is allocated in terms of bytes. Except for characters available. with Japanese character support (e.g., Kanji), each character requires one byte of storage.

Note: LONG VARCHAR is flagged as non-ANSI when the SQL flagger is enabled.

The column offset points to the actual location of the data.

The default display format for LONG VARCHAR(n) is X(32000).

TT

Il I I Il

5-28

Teradata RDBMS for UNIX SQL Reference
Data Definition

Specifying Case for Character Data

Specifying Case for Character Data

Introduction

Users can operate in either ANSI mode or in Teradata mode. The current release’s changes concern the definition of data in columns of tables and the interpretation of character string literals parsed as queries are executed.

If CASESPECIFIC or NOT CASESPECIFIC is omitted from the column definition, the option may be included in an SQL request.

In character string comparisons, if either of the strings being compared is CASESPECIFIC, the comparison is CASESPECIFIC.

Execution of Views, Macros, and CHECK constraints in tables may involve parsing character string literals at execution time, as well as character string literals in queries.

Refer also to Chapter 7, “Queries: The SELECT Statement”, “ORDER BY Clause”, ‘CASESPECIFC Option’.

Teradata Mode

In Teradata mode, all character data defaults to NOT CASESPECIFIC. In either mode, this default can be overridden (although this is a Teradata extension).

ANSI Mode

In ANSI mode, all character data defaults to CASESPECIFIC. Case blind comparisons may be done via the UPPER function, applied to any character string value that is not assured to contain no lower case latin letters.

See also Chapter 6, “Logical Expressions - expr: Caseblind Comparisons”. NOT CASESPECIFIC is another way of doing case blind comparisons. UPPER is the preferred ANSI method.

Note: The UPPER function is an ANSI defined function, and is not the same as declaring a value UPPERCASE, which is not ANSI. The syntax of the UPPER function is:

----UPPER — (character_string_expr)-

HH01A076

Note: Explicit declarations of CASESPECIFIC and NOT CASESPECIFIC are flagged as non-ANSI when the SQL flagger is enabled.
Previous << 1 .. 36 37 38 39 40 41 < 42 > 43 44 45 46 47 48 .. 241 >> Next