Db2 – Extract column definitions from an IXF file of unknown origin

db2

Suppose someone exported the table PROPERTIES using the command:

 CALL SYSPROC.ADMIN_CMD( 'EXPORT TO /tmp/properties.ixf OF IXF
    MESSAGES ON SERVER select * from properties' );

Since then the column order has changed, some were dropped, some added, but I need to load data from that IXF file into the columns that still exist. I don't know what columns the file contains. Running IMPORT without mapping them explicitly will fail.

I can only think of loading the file into a temporary table, then create a proper mapping:

CALL SYSPROC.ADMIN_CMD( 'IMPORT FROM /tmp/properties.ixf OF IXF
    MODIFIED BY FORCECREATE ROWCOUNT 0 MESSAGES ON SERVER CREATE INTO TEMP12345' );

Problems:

Best Answer

The IXF format is documented in the manuals. Conceivably, if other methods don't work as you would like them to, you could write a script to extract column definitions.