Connect to Informix (FireDAC)

From RAD Studio

Go Up to Database Connectivity (FireDAC)

This topic describes how to connect to Informix database.

Supported Versions

The FireDAC native driver supports Informix version 8 and later.

Windows Client Software

FireDAC requires the IBM INFORMIX ODBC DRIVER x86 or IBM INFORMIX ODBC DRIVER (64-bit) x64 ODBC driver to be installed on the workstation. These drivers are part of the Informix Client SDK; see more details here.

After installing, run <client>\bin\setnet32 to register the database servers.

If the Informix ODBC driver has not been properly installed, an exception is raised when you try to connect:

[FireDAC][Phys][ODBC][Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Driver Linkage

To link the driver:

Connection Definition Parameters

An Informix database server must be registered on the client workstation using "<client>\bin\setnet32" utility. To connect to the registered database, an application should specify its name using the Server parameter. Also specify Database, User_Name and Password parameters (see Defining Connection (FireDAC) for details).

DriverID=Infx

Parameter Description Example value
Server Registered database server name. ol_informix1170
Database Database name. sysuser
User_Name The Informix user name. informix
Password The DB user password. Note that passwords with both '{' and '}' are not supported. i
ReadTimeout Controls the amount of time, in seconds, before an application times out while attempting to read from a connection (0 specifies an infinite wait). For example, when fetching rows. 30
WriteTimeout Specifies the number of seconds that determines how long the application will attempt to send data to the server before the Informix ODBC driver closes connection (0 specifies an infinite wait).The default value is 0. 30
LoginTimeout Controls the amount of time, in seconds, before an application times out while attempting to establish a connection (0 specifies an infinite wait). 30
CharacterSet Specifies client locale (CLOC ODBC parameter). en_US.CP1252
StringFormat

Defines how to represent String values:

  • ANSI -- always represents as ftString / ftMemo (default).
  • Unicode -- always represents as ftWideString / ftWideMemo.
Unicode
ODBCAdvanced Allows you to specify any other additional ODBC connection parameter value. The default value is "IGNOREWARNINGS=1".
MetaDefSchema Default schema name. The design time code excludes the schema name from the object name if it is equal to MetaDefSchema. informix
TxSupported Specifies if the Informix database supports SQL transactions or not.
  • Yes. The Informix database supports transactions.
  • No. The Informix database does not support transactions.
  • Choose. The ODBC driver queries the database, and sets the proper value for this parameter (depending on whether the Informix database supports transactions or not).
Choose
TxRetainLocks Specifies whether the RETAIN UPDATE LOCK option is enabled or not.
  • Yes. The RETAIN UPDATE LOCK option is enabled, which means that the database server retains the update lock until the end of the transaction. This is the default value.
  • No. The RETAIN UPDATE LOCK option is not enabled.
Yes
TxLastCommitted Specifies whether the LAST COMMITTED option is enabled or not. It is useful in contexts where an application attempts to read a row locked by another session. If this option is enabled, then, the database server returns the most recently committed version of the row, rather than wait for the lock to be released.
  • Yes. The LAST COMMITTED option is enabled. This is the default value.
  • No. The LAST COMMITTED option is not enabled.
Yes

Use Cases

  • Connect to Informix database server:
DriverID=Infx
Server=ol_informix1170
Database=sysuser
User_Name=informix
Password=mypwd
MetaDefSchema=informix

Informix on Linux

Starting with RAD Studio 13.2, it is possible to use FireDAC with IBM Informix ODBC Driver on Linux. Follow the steps and see a sample below.

  1. Install IBM Informix Client SDK/ODBC driver.
  2. Configure the .odbc.ini file with an Informix DSN. The DSN must include: Driver, Database, ServerName, LogonID/pwd, and the GLS settings CLIENT_LOCALE, DB_LOCALE, and TRANSLATIONDLL.
  3. Add an [ODBC] section with the UNICODE setting. For the tested FireDAC/Linux configuration, UNICODE=UCS-2 was required. Depending on the driver manager and platform, IBM documentation may recommend UNICODE=UCS-4.
  4. Add DELIMIDENT=1 if the application uses quoted or mixed-case identifiers such as "Customers".

See an example below:

[InformixDemo]
Driver=/opt/IBM/Informix.15.0.1.0/lib/cli/iclis15a.so
Description=IBM Informix ODBC Driver
Database=delphi_demo
ServerName=ol_informix15
LogonID=informix
pwd=informix
CLIENT_LOCALE=en_us.8859-1
DB_LOCALE=en_us.8859-1
TRANSLATIONDLL=/opt/IBM/Informix.15.0.1.0/lib/esql/igo4a304.so
; Required when using quoted / mixed-case identifiers, e.g. "Customers"
DELIMIDENT=1
[ODBC]
; Required for Unicode ODBC applications on UNIX.
; Depending on driver manager / platform IBM documents UCS-4 as the normal UNIX value,
; but UCS-2 may be required with some configurations.
UNICODE=UCS-2

See Also