For column values with the following data types, a code attribute can also be entered, if required: CHAR[ACTER], VARCHAR, CLOB
A code attribute defines the sort sequence to be used for comparing values.
Code Attribute |
Column Values |
---|---|
No code attribute |
The column values have the code attribute defined in the database system. |
ASCII |
The column values are stored in ASCII code. |
BYTE |
The column values are stored in a code, that is, the column values are not converted by the database system. |
UNICODE |
The application data in a table column is stored in Unicode. |
To define a code attribute, proceed as follows:
For column values with the data types CHAR[ACTER], VARCHAR and CLOB, a code attribute can also be entered in the column definition (column_definition), if required.
If you do not specify a code attribute, the code defined in the database system is used. The code can be defined for specific users or globally using the following options:
User specification: The code can be defined for specific database users using the corresponding SQL statements (See: CREATE/ALTER USER Statement or CREATE/ALTER USERGROUP Statement).
Global specification: The code can be defined globally when the database system is installed, using the special database parameter DefaultCodePage.
The code defined for a database user overrides the code specified globally in the database system.
You can change a code attribute. If you change the code attribute from ASCII to UNICODE, you should note that the column value cannot exceed the length of the column. You can only change the code attribute from UNICODE to ASCII if all the data can be converted into ASCII values.