CLOB code pages
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
There are two types of CLOB values:
-
DBCODEPAGE(for database tables) orTTCODEPAGE(for temp-tables) — ADBCODEPAGE CLOBis a field in a database that is in the database's codepage and uses the collation table associated with the database's codepage. ATTCODEPAGEis aCLOBfield in a temp-table that is in the code page set by the Internal Code Page (-cpinternal) startup parameter. Also, if you define a temp-table field to beLIKEaDBCODEPAGEdatabase field, the-cpinternalcode page is used for the temp-table field. -
COLUMN-CODEPAGE— When you define aCLOBfield (either in a database or a temp-table) you can use COLUMN-CODEPAGE to specify the code page of theCLOBas well as a valid collation for that code page.
If you do not specify a code page for a CLOB field
in a temporary table, the default code page is -cpinternal. In
the following example, clopcp and clopdb are CLOB fields
defined elsewhere. The clopcp field is a COLUMN-CODEPAGE type
of CLOB with code page 1252. The clopdb field is
a DBCODEPAGE type of CLOB with code page UTF-8.
The code page set by -cpinternal is iso8859-1:
|
In this example, ttab1 is in -cpinternal (iso8859-1)
because that is the default code page for CLOB fields
in a temp-table. The code page for ttab2 is UTF-16
because it is specifically set using the COLUMN-CODEPAGE option.
The ttab3 field has the 1252 code page because
it is defined as being LIKE clobcp which
defines the code page of that CLOB as 1252.
The ttab4 field has the -cpinternal code page (iso8859-1) since it is defined LIKE clobdb which is a DBCODEPAGE
CLOB. It is therefore converted to the code page of the temp-table, which is always
defined by -cpinternal. (You can use the DBCODEPAGE function to get the name of a connected database's code
page. For more information about the DBCODEPAGE function, see
ABL Reference.)
The ttab5 field is in TTCODEPAGE (-cpinternal).
It is defined to be LIKE clobcp but
the TTCODEPAGE keyword is specified and that overrides
the code page of clobcp.