Home | Previous Page | Next Page   Environment Variables > Environment Variables >

DBNLS (IDS)

The DBNLS environment variable specifies whether automatic data type conversion is supported between NCHAR and NVARCHAR database columns and CHAR and VARCHAR variables (respectively) of client systems.

Global Language Support (GLS) does not require the DBNLS environment variable. But Dynamic Server databases continue to support the legacy behavior of DBNLS, which supports applications that manipulate tables with NCHAR or NVARCHAR columns.

Read syntax diagramSkip visual syntax diagram>>-setenv--DBNLS--+-----+--------------------------------------><
                  +-'1'-+
                  '-'2'-'
 

For UNIX systems that use the C shell, the following command line enables client applications such as DB-Access, IBM Informix SQL, IBM Informix 4GL, IBM Informix Dynamic 4GL, and embedded-SQL applications such as ESQL/C or ESQL/COBOL to convert automatically between CHAR and VARCHAR variables of the client application and NCHAR and NVARCHAR columns of the database:

setenv DBNLS 1

This setting also supports the automatic conversion of values retrieved from NCHAR columns into CHAR variables, and the conversion of NVARCHAR column values into VARCHAR variables.

Similarly, when DBNLS = 1, character strings stored as CHAR variables can be inserted into NCHAR columns, and character strings stored as VARCHAR variables can be inserted into NVARCHAR database columns.

To support these features, DBNLS must also be set to 1 on the client system. This setting also enables the client system to display dates, numbers, and currency values in formats specified on the client locale.

Conversely, each of the following command lines disables automatic conversion between CHAR and VARCHAR variables of the client application and NCHAR and NVARCHAR columns of the database and also prevents Dynamic Server from using the locale files of the client system:

setenv DBNLS

unsetenv DBNLS

On UNIX systems that use the C shell, either of these commands disables automatic conversion to and from NCHAR and NVARCHAR data values (by setting no value for DBNLS).

Another possible setting for DBNLS is 2. If you enter at the command line

setenv DBNLS 2

then automatic data type conversion between NCHAR and CHAR and between NVARCHAR and VARCHAR is supported (if the client system has DBNLS set to 1 or 2), but the database server can have a different locale from the client system.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]