Long identifiers

HCL Informix® allows identifiers of up to 128 characters in length, and user names up to 32 characters in length. Other versions of Informix® database servers support an identifier length of 18 characters and a user name length of 8 characters.

The database server uses the following two criteria to determine whether the client program can receive long identifiers:
  • The internal version number of the client program
  • The setting of the IFX_LONGID environment variable

If the IFX_LONGID environment variable is set to 0 (zero) the database server treats the client as if it cannot handle long identifiers. If IFX_LONGID is set to 1 (one) and the client version is recent enough, then the database server treats the client as if it is able to receive long identifiers. If IFX_LONGID is not set it is treated as if it is set to 1 (one).

Important: If you set IFX_LONGID in the environment of the client, it takes effect only for that client. If you set the IFX_LONGID environment variable in the environment of the database server, it takes effect for all client programs.

For more information about the IFX_LONGID environment variable, see the Informix® Guide to SQL: Reference.

Client programs that meet the following conditions can use long identifiers and long user names without recompiling:
  • It was compiled with a version of ESQL/C that was released later than version 9.20
  • It uses shared libraries (that is, program was compiled without the -static option)

If the database server truncates a long identifier or long user name, it sets the SQLSTATE variable to '01004' and sets the sqlwarn1 flag to 'W' in the SQL Communications Area (sqlca).