load2.tar file submitted by Robert Sosnowski (author),
current version 1.70, December 1, 2007
Short description of the software:
Library of ESQL/C generic data load/unload functions for Informix database
+ couple of useful utilities which makes use of this library (xml loader
for example).
You can embed library in your own application directly or you can just use
provided simple utilities.
Requirements:
For compiling sources: Informix csdk 2.30 or better, for running binaries:
connect 2.30 or better. If you have older version of csdk or connect then
you can download a newer version from IBM/Informix site for free.
I've tested this under Linux, AIX, Win XP with IDS version 10.
Compilation:
Under Unix:
./configure
make
Under Windows:
1) With Cygwin
CSDK have to be installed in directory not containing any spaces. Otherwise
configure process fails.
./configure
make
You can also invoke configure with different compilers to override
default one:
./configure CC=cl # for MSVC compiler
./configure CC=bcc32 # for Borland, I've used free bcc ver 55
./configure CC=lc # for free lcc-win32 compiler
./configure CC=gcc # for free GNU compiler
Other compilers are not supported.
You have to configure yourself Cygwin environment in such a way that
chosen compiler is able to compile some C code.
2) Without Cygwin
Copy makefile and load2cfg.h from nt directory into the main one.
Edit path to Informix in Makefile.
For compiling loadx utility you need expat library.
configure is able to detect if expat library is properly installed. If so loadx
utility will be created.
Performance:
I've noticed that all load/unload utilities (dbaccess, dbload) based on ESQL/C
which are using sqlda have almost the same top performance. Better performance
is only in HPL (much better) in case of direct load. ESQL/C programs
with sql descriptors have worse performance. Example: DBD:Informix.
Then lowest performance is with ODBC.
Provided utilities belong to the ESQL/C with sqlda class so load/unload
can be done in similar time as with dbaccess.
Using insert cursor doubles data transfer performance. Insert cursor is
supported.
Utilities:
load - for loading data from unl file to the database. Advantages over other
solutions: reading several files at once, reading data from stdin,
better than standard error messages, loading to remote server, support for
gziped unloads.
unload - unload in .unl format. Advantages: unload to stdout, unload from
remote Informix server, support for gzipped unloads.
unloadx - unload in xml (or html) format
loadx - loads xml into database
An expat library is required to compile it. It can be downloaded
from http://sourceforge.net/projects/expat.
I do not have anything for comparison but: loader is written with ESQL/C
- fastest available API and with expat which is one of the fastest xml
parsers. So loadx is probably fastest xml loader for Informix database.
loadinc - incremental loader:
- it updates data if already exist (upsert functionality);
- there is a mode in which first column specifies what to do with the rest
of the record: column value 0 means update, 1 - insert, 2 - delete.
This mode is very useful for data replication based on triggers
and exchanging data with files (see dbdiff.txt); this mode is used
in my company for trigger-based data replication.
tbcopy - copying data between tables
Idea borrowed from dbcopy but implementation totally different. It was made for
the purpose to check if both unloading & loading functions can coexist in one
application.
Features & performance similar to Art Kagel's dbcopy (because of utilizing
the same featueres: insert cursors and fetch array).
simple_load & simple_unload functions are ready to be embeded in ESQL/C
application. It can be done by calling these functions in following way:
simple_unload("select * from tab1", "tab1.unl");
simple_load("insert into tab2", "tab1.unl");
Limitations:
No support for IDS 2000 extended data types except blobs (both simple and smart).
History:
Version 1.1 October 22, 2001
First public release of load.
Version 1.2 November 18, 2001
Added unload stuff. XML with DTD output format supported by unloadx
utility.
Version 1.3 July 05, 2002
Internal redesign of loading functions for better flexibility.
Added loadinc utility.
Version 1.4 April 09, 2003
Added configure stuff and BLOB handling.
Version 1.5 December 01, 2003
Added internal (un)gzipping if zlib library is available.
Added new make targets: make install & make uninstall .
Fetch array handling for faster unloads via the net; in practice
it appeared that performance increase is small.
New utility: tbcopy
New public functions: simple_load & simple_unload
Version 1.6 October 11, 2004
Added dbdiff utility for comparing table contents - see dbdiff.txt.
Version 1.66 October 17, 2005
Maintenance release. Fixed compatibility with CSDK 2.90 (patch from
Jonathan Leffler). Fixed CPPFLAGS handling.
Fixes for TEXT handling on WIN32 thanks to Andreas Zeugswetter.
Changed default file mode to binary while unloading. Text mode is
incorrect if CHAR or TEXT field contains \r or \n characters because
unloaded field differs from that stored in database.
New option in loadinc to not replicate data in ER.
Version 1.70 December 1, 2007
In September my company have migrated from 7.31 on SCO to 10.0 on AIX.
Therefore I've made changes necessary to compile it on a new platform.
In particular changes for 64-bit platform were introduced.
I've added also smart blobs support as we intend to use it in near
future.
SCO platform soon will not be available for me so I've tested on SCO
for the last time.
Other changes: unloadx can produce XMLSchema (MS dialect) and xsl
for transforming xml file back into unload format.
Precompiled binaries for Linux, Windows, AIX & SCO are available
at http://robsosno.googlepages.com/downloads