Character data processed or stored by PL must be represented in bytes. The byte representation of a single character is called a character code, and a set of character codes is called a character set.
OceanBase Database supports both the database character set and the national character set. PL also supports these character sets.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL-compatible mode.
Database character set
PL uses the database character set to represent the following information:
The source text stored in PL units.
Character values of the
CHAR,VARCHAR2,CLOB, andLONGdata types.
A database character set can be single-byte, mapping each supported character to a specific byte, or variable-width, mapping each character to one, two, three, or four bytes. The maximum number of bytes in a character code depends on the specific character set.
Each database character set includes the following basic characters:
Latin letters: A to Z and a to z
Digits: 0 to 9
Punctuation marks (see the following table)
Space characters: space, tab, line feed, and carriage return
PL source text that uses only basic characters can be stored and compiled in any database. PL source text that uses non-basic characters can be stored and compiled only in databases that support those non-basic characters.
The following table lists the punctuation characters in the database character set.
| Symbol | Name |
|---|---|
| ( | Left parenthesis |
| ) | Right parenthesis |
| < | Left angle bracket |
| > | Right angle bracket |
| + | Plus sign |
| - | Hyphen or minus sign |
| * | Asterisk |
| / | Slash |
| = | Equal sign |
| , | Comma |
| ; | Semicolon |
| : | Colon |
| . | Period |
| ! | Exclamation mark |
| ? | Question mark |
| ' | Apostrophe or single quotation mark |
| " | Quotation mark or double quotation mark |
| @ | At sign |
| % | Percent sign |
| # | Number sign |
| $ | Dollar sign |
| _ | Underscore |
| | | Vertical bar |
National character set
PL uses the national character set to represent character values of the NCHAR, NVARCHAR2, and NCLOB data types.