INFORMIX
Informix Guide to GLS Functionality
Chapter 8: INFORMIX-ESQL/C Features
Home Contents Index Master Index New Book

Locale-Sensitive Character Data Types

The SQL data types NCHAR and NVARCHAR support locale-specific data. (For more information about these data types, see "Using Character Data Types".)

ESQL/C supports the predefined data types string, fixchar, and varchar for host variables that contain character data. In addition, you can use the C char data type for host variables. The following table shows which of these host-variable data types you can use for NCHAR and NVARCHAR data.
Locale-Sensitive Data Type char

fixchar

string

varchar

NCHAR

3

3

3

3

NVARCHAR

3

3

3

Tip: For general information on how to use these host-variable data types with character data, see Chapter 3 of the "INFORMIX-ESQL/C Programmer's Manual."
Your ESQL/C program can access columns of data types NCHAR and NVARCHAR when it selects into or reads from character host variables. The following code fragment declares a char host variable, hôte, and then selects NCHAR data into the hôte variable:

When you declare ESQL/C host variables for the NCHAR and NVARCHAR data types, keep in mind the relationship between the declared size of the variable and the amount of character data that it can hold, as follows:

    In this case, you must ensure that you declare an ESQL/C host variable large enough to accommodate the number of characters that you expect to receive from the database.

For more information, see "The NCHAR Data Type" and "The NVARCHAR Data Type".

You can insert a value that a character host variable (char, fixchar, string, or varchar) holds in columns of the NCHAR or NVARCHAR data types. For more information about how to insert host variables into the NCHAR and NVARCHAR data types, see Chapter 3 of the INFORMIX-ESQL/C Programmer's Manual.




Informix Guide to GLS Functionality, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.