LOAD and UNLOAD
Informix®
Informix provides two SQL instructions to export / import data from / into a database table:
UNLOAD instruction copies rows from a database table into a text
file:UNLOAD TO "filename.unl" SELECT * FROM tab1 WHERE ..The
LOAD instructions insert rows from a text file into a database
table:LOAD FROM "filename.unl" INSERT INTO tab1SAP ASE
SAP® ASE has LOAD and
UNLOAD instructions, but those commands are related to database backup and
recovery. Do not confuse with Informix commands.
Solution
LOAD and UNLOAD instruction are implemented in the Genero BDL
runtime system with basic INSERT (for LOAD) or
SELECT (for UNLOAD) SQL commands. The
LOAD and UNLOAD instruction can be
supported with various database servers.
However, LOAD and UNLOAD require the description of the column
types in order to work, that can lead to some differences in the data formatting.
LOAD instruction will automatically execute
a BEGIN WORK and COMMIT WORK when finished, or ROLLBACK
WORK if a row insertion failed while loading. Terminating a transaction will automatically
close cursors not defined WITH HOLD option. To workaround this situation, see more
details in the LOAD reference topic.The LOAD and UNLOAD BDL instructions are supported with SAP ASE with some limitations:
-
The
LOADinstruction does not work with tables using emulatedSERIALcolumns because the generatedINSERTstatement holds theSERIALcolumn which is actually aIDENTITYcolumn in SAP ASE. See the limitations ofINSERTstatements when usingSERIALtypes. -
With SAP ASE, Informix
DATETIMEdata is stored inBIGDATETIMEcolumns, butBIGDATETIMEcolumns are similar to InformixDATETIME YEAR TO FRACTION(5)columns. Therefore, when usingLOADandUNLOAD, those column values are converted to text data with the format "YYYY-MM-DD hh:mm:ss.fffff".