Frequently Asked Questions about IBM Informix Database Driver for Perl DBI
==========================================================================

Informix Database Driver for Perl DBI Version 2018.1029 (2018-10-28)

--------------------------------------------------------------------------

WHAT IS THE DIFFERENCE BETWEEN IBM INFORMIX DATABASE DRIVER FOR PERL DBI
AND DBD::INFORMIX?

Spelling.

The official product name had to be changed from DBD::Informix to IBM
Informix Database Driver for Perl because the acronym DBD is a contested
trademark of two other companies in the USA, so Informix could not release
the product as DBD::Informix without potentially infringing on this
trademark, and when IBM bought Informix (2001-07-01), the IBM name was
prefixed to Informix products.  Internally, Perl and DBI still uses the
name DBD::Informix to access the driver, and much of the documentation
still references DBD::Informix because that is how Perl references it, and
because it is less of a mouthful than IBM Informix Database Driver for
Perl DBI.

--------------------------------------------------------------------------

HOW DO I REPORT TECHNICAL PROBLEMS WITH DBD::INFORMIX?

See the information available via "perldoc DBD::Informix::TechSupport" and
in the README file.

--------------------------------------------------------------------------

WHY IS IBM INFORMIX ESQL/C A PRODUCT PREREQUISITE FOR DBD::INFORMIX?

DBD::Informix is freely available software that is licensed on the same
terms as Perl, under the GNU General Public License or the Perl Artistic
License.

However, to compile or use DBD::Informix, you need some IBM Informix
software on your computer -- specifically, you need either IBM Informix
ESQL/C or IBM Informix Client SDK.  This provides a compiler and the
supporting libraries necessary to connect to Informix databases.  This
software must be licenced from IBM.

To purchase any IBM Informix software, look in the the IBM Informix Web
site (http://www.ibm.com/software/data/informix), or contact your local
IBM Sales Office.

IBM Informix ClientSDK may be downloaded for some platforms from:
	http://www.ibm.com/software/data/informix/downloads.html

--------------------------------------------------------------------------

WHERE CAN I FIND DOCUMENTATION FOR IBM INFORMIX PRODUCTS?

You can download PDF files for most IBM Informix product manuals at the
IBM Informix web-site:

	http://www.ibm.com/software/data/informix/pubs

Electronic manuals are not available for some of the older product
versions (but they are truly obsolete and should not be in use).

---------------------------------------------------------------------------

WHICH VERSIONS OF ESQL/C AND CLIENT SDK ARE SUPPORTED?

For details on which versions of ESQL/C and Client SDK are supported,
consult the documentation:

	perldoc DBD::Informix::TechSupport

--------------------------------------------------------------------------

WHICH OTHER VERSIONS OF IBM INFORMIX ESQL/C EXIST?

Informix ESQL/C exists in obsolete versions 2.x, 4.x, 5.x, 6.x, 7.x,
8.x, and 9.x.  It also exists in the currently supported versions as
part of ClientSDK 3.00, 3.50, 3.70, 4.10.

Any of the really old Informix (pre-IBM) versions earlier than version
5.00 from 1990 (such as ESQL/C 2.x, 4.x) is very obsolete and cannot be
used to build DBD::Informix.

NB: IBM (re)released ESQL/C 4.x as part of a CSDK 4.x; such versions are
supported by the version checking.  The original versions 4.00 and 4.1x
date back to 1988 or 1989.  Informix happened to skip versions 3.x back
in the 80s.

    Former Name       Current Name
    -----------       ----------------------
    ESQL/C 9.11     - ESQL/C 9.11 (obsolete)
    ESQL/C 9.12     - DevSDK 9.12 (obsolete)
    ESQL/C 9.13     - Client SDK 2.00 (obsolete)
    ESQL/C 9.14     - Client SDK 2.01 (obsolete)
    ESQL/C 9.15     - Client SDK 2.02 (obsolete)
    ESQL/C 9.16     - Client SDK 2.10 (obsolete)
    ESQL/C 9.20     - Client SDK 2.20 (obsolete)
    ESQL/C 9.21     - Client SDK 2.30 (obsolete)
    ESQL/C 9.30     - Client SDK 2.40 (obsolete)
    ESQL/C 9.40     - Client SDK 2.50 (obsolete)
    ESQL/C 9.50     - Client SDK 2.60 (obsolete)
    ESQL/C 9.51     - Client SDK 2.70 (obsolete)
    ESQL/C 9.52     - Client SDK 2.80 (obsolete)
    ESQL/C 9.53     - Client SDK 2.81 (obsolete)
    ESQL/C 2.90     - Client SDK 2.90 (obsolete)
    ESQL/C 3.00     - Client SDK 3.00 (Jul 2007)
    ESQL/C 3.50     - Client SDK 3.50 (May 2008)
    ESQL/C 3.70     - Client SDK 3.70 (Oct 2010)
    ESQL/C 4.10     - Client SDK 4.10 (Mar 2013)

For IDS 11.10, you should use Client SDK 3.00; for IDS 11.50, you should
use Client SDK 3.50; for IDS 11.70, you should use ClientSDK 3.70; for
IDS 12.10, you should use ClientSDK 4.10.  Finally, note that Client SDK
is available free of charge, so you should use it if at all possible.

DBD::Informix no longer supports ClientSKD 2.x, and doesn't strictly
support CSDK 3.00 because IBM and HCL no elonger support the Informix
11.10 server.  Indeed, CSDK 3.50 and Informix 1h1.50 went out of service
at the end of April 2018 and are not really supported either - but there
is nothing known to stop DBD::Informix from working with CSDK 3.00 or
3.50.

---------------------------------------------------------------------------

WILL DBD::INFORMIX WORK WITH ANY OF THESE OTHER VERSIONS?

It is believed that DBD::Informix will work with any version of ESQL/C
from version 9.20 upwards.  However, it has not been tested with every
such version, and many of these versions are obsolete.  It has also not
been tested on every platform.

Note that there is some code in Makefile.PL which enforces 'this version
is obsolete' rules on ESQL/C.  You may need to remove that code - but it
would be better to upgrade.

---------------------------------------------------------------------------

DO I NEED AN IBM INFORMIX DATABASE SERVER ON MY DEVELOPMENT MACHINE?

You do not need an IBM Informix database server on the computer where you
build or use DBD::Informix.  However, to compile DBD::Informix, or to make
any meaningful use of it after it is compiled, you must have access to a
computer with an IBM Informix database server installed and running on it.
One step of the configuration process for DBD::Informix validates your IBM
Informix ESQL/C and database environments and checks that you have access
to at least one database.  If this step fails, the makefile is not
generated, so DBD::Informix cannot be compiled.

If you do not have the IBM Informix database system set up already, you
need to do so before you try to compile DBD::Informix.  If you do not know
how to do the setup, you must obtain the necessary training.  IBM does
provide training courses in such matters; consult the Web site or your
local sales office as mentioned above.

--------------------------------------------------------------------------

WHICH IBM INFORMIX DATABASE SERVERS ARE AVAILABLE?

IBM Informix provides a large family of products, many of which are
available in a number of versions.  Database storage is managed by a
program separate from user applications (such as Perl + DBI +
DBD::Informix).  Such a database management program is called the database
server.  The main Informix database servers are listed below.

Refer to http://www.ibm.com/software/data/informix for additional
product information.

    Informix Standard Engine (SE)                   5.x and up
    Informix OnLine                                 5.x
    Informix OnLine Dynamic Server (ODS)            6.x or 7.x OnLine
    Informix OnLine Workgroup Server (WGS)          7.x versions, UNIX and NT
    Informix OnLine Workstation (OWS)               7.x versions, NT
    Informix OnLine Extended Parallel Server (XPS)  8.x OnLine
    Informix Universal Server (IUS)                 9.x

In 1998, Informix renamed the following products:
    Informix Dynamic Server (IDS)  7.3
    Informix Dynamic Server with Universal Data Option (IDS/UDO) 9.1x
    Informix Dynamic Server with Advanced Decision Support Option 
      (IDS/ADSO) 8.x
    Informix Dynamic Server with Extended Parallel Option (IDS/XPO) 8.x

In July 1999, the new Informix Internet Foundation.2000 products were 
released and included:
    Informix Dynamic Server.2000 (IDS.2000) 9.2x
    Informix Internet Foundation.2000 (IIF.2000) 9.2x

In 2001, the 2000 appellation was dropped.

In 2004, the current version of IDS was  9.40.
In 2005, the current version of IDS was 10.00.
In 2007, the current version of IDS was 11.10.
In 2008, the current version of IDS was 11.50.
In 2010, the current version of IDS was 11.70.
In 2013, the current version of IDS was 12.10 (and that is current in May 2018).

Thus, IDS 11.70 or later are the only fully supported Informix data
servers.

To use DBD::Informix, you need to have access to an Informix database
server, which means that you need Informix on one of the
computers in your network.  DBD::Informix will probably be of no use to you
unless you have access to a database.  You must know the version number of
the database server to ensure that you compile DBD::Informix with a
compatible version of Informix ESQL/C and run it in a compatible runtime
environment.

--------------------------------------------------------------------------

CAN DBD::INFORMIX BE COMPILED WITHOUT IBM INFORMIX ESQL/C?

To compile DBD::Informix, you need an IBM Informix ESQL/C compiler.
Once upon a long time ago, it was possible to build using Informix 4GL
instead of ESQL/C; that is no longer supported.

--------------------------------------------------------------------------

CAN DBD::INFORMIX RUN ON A COMPUTER DIFFERENT FROM WHERE IT WAS COMPILED?

To run DBD::Informix only on the computer where you compiled it, you do not
need any extra software, and you can skip the rest of this subsection.

To run DBD::Informix on a different computer from where you compiled it,
the other computer must have the same architecture as the computer used for
compiling.  However, the computers need not be identical; for example, code
compiled on a Sun Sparc 20 can be run on a Sun Sparc 10.

Every computer where you will use DBD::Informix must have either an IBM
Informix ESQL/C development license, or an IBM Informix runtime license.
Otherwise, you violate the terms of your license agreement with IBM
(Informix).  Either way, the license on the other computer should be the
same version as the development license used to compile the software.
(If you know enough about the compatability requirements for different
versions of Informix products to argue about the finer points ignored by
the "same version" criterion, you probably do not need to read this.)

Further, both the DBI and DBD::Informix modules will need to be installed
on the second machine, and should go into the same directory on both
machines.  That means that Perl must be installed in the same location on
both machines.  And unless you compiled DBD::Informix with the environment
variable DBD_INFORMIX_RELOCATABLE_INFORMIXDIR set, you will need to have
the Informix software installed in the same place on both machines.

--------------------------------------------------------------------------

MY PROGRAM WORKS OK WHEN I RUN IT FROM THE COMMAND LINE BUT FAILS WHEN I
RUN IT VIA A WEB SERVER (CGI, MOD_PERL, ETC), OR FROM A CRON JOB?

The answer is the environment - almost invariably.

You should establish exactly what the environment is when your script is
run, using some surrogate for your real script that uses DBI and
DBD::Informix.  Then you will have to work out how to set the INFORMIXDIR,
INFORMIXSERVER and LD_LIBRARY_PATH environment variables properly.  With
Apache, this is usually the SetEnv directive (possibly PassEnv instead).
Other web servers will have equivalents.  You could also consider trying to
set the environment in a BEGIN block, but it may well set the environment
too late to be useful.

Note that DBD::Informix version 1.00 and later normally build the
DBD::Informix shared library so that it references the Informix shared
libraries with absolute pathnames.  This should mean that the web server
does not need to set LD_LIBRARY_PATH or the local equivalent environment
variable.  The configuration process records a default value for
INFORMIXDIR and INFORMIXSERVER; these may be adequate for your production
environment.

Similar comments apply to jobs run by cron.  Unlike jobs run with the
'at' command, cron jobs get only the most minimal environment set.  You
should ensure that the environment is set correctly by a script before
it attempts to access DBD::Informix.

--------------------------------------------------------------------------

IN THE FOLLOWING CODE, I GET ERROR -280 (A QUOTED STRING EXCEEDS 256 BYTES)
WHEN THE VALUE OF $LONGCHARSTRING CONTAINS MORE THAN 256 CHARACTERS.  THIS
IS ODD BECAUSE LONGCHARCOL IS DEFINED TO CONTAIN MANY MORE THAN 256
CHARACTERS (EG CHAR(2500)).

Please note that IDS version 9.30 and later and corresponding versions
of ESQL/C do not impose this limitation.  It could be time to upgrade.

	$sql = "INSERT INTO SomeTable(LongCharCol) VALUES('$longcharstring')";
	my $sth = $dbh->prepare($sql) or die($DBI::errstr);
	$sth->execute() or dir($DBI::errstr)

ESQL/C has an irritating limitation that the longest character string
literal that it allows is 256 characters long.  Furthermore, in most
versions, you cannot embed newlines in string literals.  There's a simple
workaround which always works; use a place-holder in place of the string.
This has the additional advantage of not breaking when the $longcharstring
variable itself contains quote characters, whereas the example code will
break.

	$sql = "INSERT INTO SomeTable(LongCharCol) VALUES(?)";
	my $sth = $dbh->prepare($sql) or die($DBI::errstr);
	$sth->execute($longcharstring) or dir($DBI::errstr)

Using placeholders is also the most reliable way to enter user defined data
into the database (eg from a web page).  If you take arbitrary data typed
by the user, even using the $dbh->quote method, it may be possible for the
user to break your system.  In the original example, if $longcharstring
contains:

	'); DELETE FROM SomeTable; DROP TABLE OtherTable; COMMIT WORK;

and you run the command as written, then your database might be missing two
(presumably important) tables.  Ensure that the web user has the minimum
possible privileges (CONNECT for the database, and no more than the minimum
necessary table-level privileges on any table).

--------------------------------------------------------------------------

WHEN I TRY TO BUILD THE SHARED LIBRARY, I GET AN ERROR MESSAGE ABOUT
LOTS OF MISSING SYMBOLS LIKE PERL_NEWAV (REFERENCED IN DBDATTR.O)
AND PERL_NEWSV (REFERENCED IN INFORMIX.O) AND MAIN.  WHAT'S UP?

This most frequently occurs when you need to modify the esql script to
change the default compiler from cc to (typically) gcc, and you don't
respect the INFORMIXC environment variable.  At the start of the original
esql script is a line that reads:

        CC=${INFORMIXC=cc}                  # Original version

If you need to change that to use gcc by default, then modify it to keep
the option of overriding the C compiler with the INFORMIXC environment
variable, because DBD::Informix uses INFORMIXC to ensure that it can build
the shared library on many systems (specifically, this is necessary on
Solaris 2.6, Solaris 7 and Linux; it will be necessary on many SVR4-derived
systems).

	CC=${INFORMIXC=gcc}                 # Correct change
	CC=${INFORMIXC=/usr/local/bin/gcc}  # Correct change

	CC=gcc                              # Incorrect change
	CC=/usr/local/bin/gcc               # Incorrect change

Why?  On these platforms, the -G option needs to be relayed to the C
compiler or loader, but the esql script thinks that -G is an option
intended for its own benefit.  So, to get the -G option to the C compiler,
it is set in the ESQLLD environment variable, and INFORMIXC is set to run
the esqlld Perl script.  If you modify esql to ignore INFORMIXC, you make
it ignore a lot of hard work -- and cause the build to fail.

--------------------------------------------------------------------------

HOW CAN I UPDATE BLOBS

You cannot update BYTE and TEXT blobs fully automatically with
DBD::Informix.  You can insert them; you can delete them; you can select
them; all without paying very much attention to the issues.  You cannot
update them without using special measures.

Technically, the DESCRIBE request must give DBD::Informix information
about the types of the paramaters on the RHS of the SET clause in an
UPDATE statement.  Without that type information, DBD::Informix does not
know that it needs to treat the parameter specially.  [This should
change in 2003 when IBM releases IBM Informix ClientSDK 2.81 - ESQL/C
9.53 - and IBM IDS 9.40, but the feature won't be available on older
versions of the servers.]

On the other hand, starting with version 1.03.PC1, you can update them.
See the code in test file t/t73blobupd.t for an illustration of how to
do it using the Informix type support with bind_param (and, one day,
bind_param_inout).  See also 'perldoc DBD::Informix'.

--------------------------------------------------------------------------

WHEN I DO "perl makefile.PL" IT FAILS WITH ERROR -369.  IT ALSO FAILS
WITH THAT ERROR IF I TRY TO RUN esqlbasic.  WHAT DOES IT MEAN AND WHAT
MUST I DO TO FIX IT?

Error -369 always means that the ESQL/C you are using is not installed
correctly.  Usually it means that: 1) although you copied off the
distribution media, you did not run the installesql script.  You need to
provide a serial number (eg AAA#A123456) and an activation key (eg
ABCDEF).  Until you do this, the software will not let you use the
libraries at runtime, even if you can compile with it.  Or, 2) if you
installed ESQL/C correctly, something else was subsequently installed
incorrectly and wrote over one of the ESQL/C libraries.  Either way, the
corrective action is to reinstall either the ESQL/C product or the other
product which overwrote the ESQL/C libraries.

The other circumstance under which this can occur with ClientSDK 2.80 or
later is if there is an internal error in the installation process.  The
licence number for such versions should be supplied automatically; if
you get this error, then there is probably a bug in the installation
code.

--------------------------------------------------------------------------

HOW DO I CONFIGURE DBD::INFORMIX TO CONNECT TO A REMOTE DATABASE?

How do you connect using DB-Access across the network?  That's how you
connect using DBD::Informix, too.  For example, you will create an entry
in your local sqlhosts file that references the remote system:

    remote_tcp  oltlitcp    remote  service_name

You will then simply do:

    $dbh = DBI->connect("dbi:Informix:dbase\@remote_tcp", "", "")
                or die "A horrible death!";

Note that if you also had a local database, you'd have an entry in the
sqlhosts file such as:

    local_shm   olipcshm    local   service_name

And your connect statement will be:

    $dbh = DBI->connect("dbi:Informix:dbase\@local_shm", "", "")
                or die "A horrible death!";

Or, in other words, there is essentially no difference between the local
and remote connections.  If you need to specify username and password,
do so in place of the empty strings.  If you want to omit the '\@server'
part, you can set $INFORMIXSERVER to the correct value.

NB: The default value of $INFORMIXSQLHOSTS is $INFORMIXDIR/etc/sqlhosts.

NB: On Linux in particular, you often need the FQDN (fully qualified
domain name) of the server in place of 'local' or 'remote'.  Usually,
what 'uname -n' gives is what you need for the local machine.

===========================================================================

Jonathan Leffler
Informix Database Engineering, HCL.

@(#)$Id: FAQ,v 2018.1 2018/05/11 22:06:21 jleffler Exp $
