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 .. 28 29 30 31 32 33 < 34 > 35 36 37 38 39 40 .. 241 >> Next


For example, if data is represented on the client system in EBCDIC and a user’s terminal keyboard does not include the brace characters {}, the data “{12}” could be represented in ASCII hexadecimal as:

'7B31327D'XC

where 7B and 7D represent { and }, respectively.

XB is the only form for entering a byte string in internal ASCII from the keyboard. For example, suppose the column CodeVal has been defined as BYTE(4). To insert the characters “xy” as an ASCII hexadecimal string, use the form:

... (CodeVal) VALUES ('7879'XB) ;

To select those rows from CodeVal, specify the conditional as:

... WHERE CodeVal = '78790000'XB ;

_ _ To enter a byte string in EBCDIC hexadecimal from a mainframe,

Byte String in EBCDIC use the X’hexadecimal digits’ form.

Hexadecimal

For example:

... (CodeVal) VALUES (X'A7A8') ;

... WHERE CodeVal = X'A7A80000' ;

Note: Interpretation of the external client form is dependent on the client system. If this form is submitted from an ASCII client system or the Teradata RDBMS console, the string is taken as internal ASCII hexadecimal.

For example, an input of X’60’ from an ASCII system dumped to an EBCDIC client system will not be 60H.

On a Japanese character supported site, the hexadecimal representation can be used to define a graphic string constant under any character set. (Note that if the character set is KanjiEBCDIC, the Shift-Out and Shift-In characters must be omitted.)

A graphic hexadecimal constant can be only to a column defined as a GRAPHIC or VARGRAPHIC data type.

Constants Using XB

Constant Created Using XC

4-30

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Lexicon

Hexadecimal Constants

Under all character sets, use the following form to define a graphic hexadecimal constant:

----'hexadecimal_digits' XG -

-V — -F-

HH01A078

where:

Syntax Element ... Description
’ hexadecimal_digits’ The quoted hexadecimal representation (in the client encoding) of the multibyte character string. Note that the string must equate to an even multiple of bytes Each quote mark ( ’ ) is a single byte character.
XG The letters XG specify a hexadecimal graphic constant.
F V The letters XG can be appended by the letter F (for a fixed-length string) or V (for a variable-length string).

Note: Teradata RDBMS does not check that a hexadecimal graphic string represents valid graphic data.

The possible forms for each graphic data type are illustrated in Table 4-6.

Table 4-6

Forms for Hexadecimal Graphic Constants

Data Type Form Example
GRAPHIC ’hexadecimal_digits’XG ’82728273’XG
GRAPHIC ’hexadecimal_digits’XGF ’82728273’XGF
VARGRAPHIC ’hexadecimal_digits’XGV ’82728273’XGV

Teradata RDBMS for UNIX SQL Reference

4-31
Teradata SQL Lexicon

Graphic Constants

Graphic Constants

On a Japanese character site, graphic string constants can be used if a KanjiEBCDIC character set is in effect for the session. (For other character sets, you can use the hexadecimal representation of the graphic string.)

Note: Graphic constants are flagged as non ANSI, when the SQL flagger is enabled.

A graphic string constant has the following form:

where: — G—'< ABC >' — HH01A090
Syntax Element... Description
G The letter G specifies that the string is graphic data.
‘ ‘ Each ’ (quote mark) is a single byte character.
<ABC> ABC is the quoted string of valid KanjiEBCDIC multibyte characters, surrounded by Shift-Out and Shift-In.

A graphic constant has the following conventions:

• The target column must be a GRAPHIC or VARGRAPHIC data type.

• The constant must be enclosed within Shift-Out/Shift-In characters (as normal KanjiEBCDIC encoding requires).

• The maximum length is 127 logical (double byte) characters.

Note that the Shift-Out/Shift-In characters are not included in the byte count and are not stored as part of the graphic constant.

• The contents must be valid graphic data (multibyte characters that are printable under the KanjiEBCDIC character set in effect for the current session).

• The internal representation must be an even number of bytes.

4-32

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Lexicon

Operators

Operators

Operators are used to express logical and arithmetic operations. Operators of the same precedence are evaluated from left to right.

Parentheses can be used to control the order of precedence. When parentheses are present, operations are performed from the innermost set of parentheses outward.

SQL operations, and the order in which they are performed when no parentheses are present, are listed in Table 4-7. The following definitions apply to Table 4-3:

Term Definition
numeric Any constant, data reference, or expression having a numeric value.
string Any character string or string expression.
logical A Boolean expression (resolves to true or false).
value Any numeric, character, or byte data item.
set A collection of values returned by a subquery, or a list of values separated by commas and enclosed by parentheses.
Previous << 1 .. 28 29 30 31 32 33 < 34 > 35 36 37 38 39 40 .. 241 >> Next