Hitachi

Hitachi Advanced Database SQL Reference


6.1.3 Characters permitted in SQL statements

The following table lists the characters that are permitted in SQL statements.

Table 6‒1: Characters that are permitted in SQL statements

No.

Type

Characters permitted in SQL statements

1

Character string literals

All characters except for the character encoding X'00'

2

Other than above

  • The following characters:

    Uppercase alphabetic characters (A to Z, #, @, \)

    Lowercase alphabetic characters (a to z)

    Numeric characters (0 to 9)

    space

    underscore character (_)

  • The following special characters:

    Comma (,)

    Period (.)

    Hyphen or minus sign (-)

    Plus sign (+)

    Asterisk (*)

    Single quotation mark (')

    Double quotation mark (")

    Left parenthesis (()

    Right parenthesis ())

    Less than sign (<)

    Greater than sign (>)

    Equals sign (=)

    Circumflex (^)

    Exclamation mark (!)

    Forward slash (/)

    Question mark (?)

    Percent sign (%)

    Vertical bar (|)

    Left square bracket ([)

    Right square bracket (])

    Tab

    NL

    CR

Organization of this subsection

(1) Character encodings permitted in SQL statements

The character encodings that are permitted in SQL statements depend on the character encoding being used by HADB. The following table shows the relationship between the character encoding used by HADB and the character encodings permitted in SQL statements.

Table 6‒2: Relationship between the character encoding used by HADB and the character encodings permitted in SQL statements

Character encoding used by HADB

Character encodings permitted in SQL statements

Unicode (UTF-8)

JIS X 0221

Shift-JIS

JIS X 0201 and JIS X 0208

(2) Character handling

In character string data, each character takes up a certain number of bytes. This number is determined according to the relationship between the character encoding range and the required number of bytes, shown in the table below. If the number of bytes to the end of the character string data is less than the required number of bytes, the data is assumed to begin with a one-byte character consisting of the first byte, and the next byte is assumed to be the starting point for the next character.

Table 6‒3: Relationship between the character encoding range and the number of bytes

Character encoding used by HADB

Range of first byte

Range of second and subsequent bytes

Required number of bytes

Unicode (UTF-8)

0x00 to 0x7F

--

1

0xC0 to 0xDF

N

2

0xE0 to 0xEF

N

3

0xF0 to 0xF7

N

4

0xF8 to 0xFB

N

5

0xFC to 0xFD

N

6

Other than above

--

1

Shift-JIS

0x00 to 0x7F

--

1

0x81 to 0x9F

0x40 to 0x7E or 0x80 to 0xFC

2

Other than above

1

0xA1 to 0xDF

--

1

0xE0 to 0xFC

0x40 to 0x7E or 0x80 to 0xFC

2

Other than above

1

Other than above

--

1

Legend:

N: No range specified.

--: Not applicable.