Progress
DataServer
for ODBC Guide


Code Pages

Flexibility in managing code pages, also called character sets, is critical for international applications. When you access an ODBC data source through the DataServer, the DataServer retrieves character data as determined by the code page that the data source uses. For Progress databases, the default code page is iso8859–1; however, Progress allows you to designate code pages for the data source and for the client.

Figure 2–1 shows a possible configuration of code pages for the DataServer components and processes.

Figure 2–1: DataServer Processes and Code Pages

In the configuration shown in Figure 2–1, all components use the same code page. (For information on setting character sets for your data source, see the administration guide supplied by the vendor.) On the Progress side, if the client and the schema holder use different code pages, a conversion takes place between them.

In order for DataServer applications to manipulate data from an ODBC data source accurately, you must specify the correct code page in the schema holder. For Progress applications accessing the DataServer, the schema holder identifies the code page of the character data. The DataServer sends the data-source name for the code page to the data source to indicate the character set for the data that the data source returns.

Be sure to set the code page in the schema holder to match a code page that the ODBC data source supports. To minimize the number of translations, specify the default code page that the data source uses. If Progress does not support the data source’s code page, you can specify instead a compatible code page that is available for your data source. The directory $DLL/prolang/convmap contains conversion tables for all of the code pages that Progress supports. Check to see whether any of them match your code page.

The default code page setting in the schema holder is iso8859–1/iso_1. You can specify a different code page for the schema holder at the following times:

NOTE: It is possible to change the code page at other times; for example, by using edit programs. However, because changing the code page does not affect the data already in the database, writing new data to your database using a different code page can corrupt the data in your database.

When you specify the code page, you must supply both its Progress and its ODBC data-source name using the format <Progress name/ODBC name>; for example, iso8859–1/iso_1 (this is the default code page). If you specify only the Progress name, the DataServer attempts to supply the data-source name for you. If you supply an incorrect data-source name, the DataServer does not detect the error until run time when the connection to the data source is made, and the connection fails.

You can specify the code-page name as undefined to prevent any conversions from taking place, but you should do this only after determining that a single code page is used throughout your environment, including by the ODBC data source.

NOTE: You cannot use the PROUTIL utility to change the code page used by the DataServer.

Keep in mind that your ODBC software configuration might have local requirements for defining the proper language interface between the ODBC drivers and the data source. See your ODBC and database documentation for details.

Client Code Page

The Internal Code Page (-cpinternal) startup parameter determines the code page that the Progress client uses when it manipulates data in memory. If the Progress client uses a different code page from the code page set in the schema holder, the DataServer translates between the two code pages, so you must verify that the convmap.cp file contains a conversion table for the client and the code page setting in the schema holder. Suppose, for example, that you set the schema holder to code page ibm850 and the client might use code page iso8859–1. The convmap.cp file must include a table that converts from ibm850 to iso8859–1 and from iso8859–1 to ibm850. If convmap.cp does not include the appropriate table, you can define your own conversion table.

Progress also allows you to define your own collation tables; however, customized collation tables only take effect after data source collation when you use the DataServer to access an ODBC data source. The data source collation tables, not the Progress collation tables, have first priority when you perform comparisons and sorts. After performing comparisons and sorts, the Progress client may sort out records that do not conform to the requirements of your customized collation tables.

For example, if you use the default code page 1252/ISO and the default case-insensitive sort ordering with a Sybase data source, collation of the tilde character (~), which is ASCII character 126, sorts before all the alphanumeric characters (0–9, a–z). If you were to select data from a character column “name” with the following:

select * from table where name <=CHR(126) (the equivalent of ~) 

Sybase returns records with columns that begin with a tilde character but no alphanumeric records, since ASCII character 126 is sorted below alphanumeric characters in this Sybase collation.

Normally, the default Progress collation sorts a tilde character above all alphanumeric characters. Therefore, in order for the above example to exhibit Progress-like behavior and return alphanumeric records as well as records beginning with the tilde, the Sybase sort order for this code page would need to be modified accordingly.

Conversely, if you execute the opposite:

select * from table where name >=CHR(126) 

Sybase returns records with columns that began with a tilde character followed by all that begin with alphanumeric characters. However, the default Progress collation, which sorts the tilde higher than all the alphanumeric characters, would omit records beginning with alphanumeric characters and only return records beginning with the tilde character.

To get the full result set returned from Sybase from the Progress client would require modifying the collation table associated with the Progress code page and weighting it to match the Sybase sort order.

For a complete discussion of how Progress handles code-page issues, see the Progress Internationalization Guide.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095