Data type-specific rules governing PC/IXF file import into databases
- A valid PC/IXF numeric column can be imported into any compatible numeric database column. PC/IXF columns containing 4-byte floating point data are not imported, because this is an invalid data type.
- Database date/time columns can accept values from matching PC/IXF date/time columns (DATE, TIME, and TIMESTAMP), as well as from PC/IXF character columns (CHAR, VARCHAR, and LONG VARCHAR), subject to column length and value compatibility restrictions.
- A valid PC/IXF character column (CHAR, VARCHAR, or LONG VARCHAR)
can always be imported into an existing database character
column marked FOR BIT DATA; otherwise:
- IXFCSBCP and the SBCS CPGID must agree
- There must be a conversion table for the IXFCSBCP/IXFCDBCP and the SBCS/DBCS
- One set must be all zeros (FOR BIT DATA).
If IXFCSBCP is not zero, the value of IXFCDBCP must equal either zero or the DBCS CPGID of the target database column.
If either of these conditions is not satisfied, the PC/IXF and database columns are incompatible.
When importing a valid PC/IXF character column into a new database table, the value of IXFCSBCP must equal either zero or the SBCS CPGID of the database, or there must be a conversion table. If IXFCSBCP is zero, IXFCDBCP must also be zero (otherwise the PC/IXF column is an invalid data type); IMPORT creates a character column marked FOR BIT DATA in the new table. If IXFCSBCP is not zero, and equals the SBCS CPGID of the database, the value of IXFCDBCP must equal either zero or the DBCS CPGID of the database; in this case, the utility creates a character column in the new table with SBCS and DBCS CPGID values equal to those of the database. If these conditions are not satisfied, the PC/IXF and database columns are incompatible.
The FORCEIN option can be used to override code page equality checks. However, a PC/IXF character column with IXFCSBCP equal to zero and IXFCDBCP not equal to zero is an invalid data type, and cannot be imported, even if FORCEIN is specified.
- A valid PC/IXF graphic column (GRAPHIC, VARGRAPHIC, or LONG VARGRAPHIC)
can always be imported into an existing database character
column marked FOR BIT DATA, but is incompatible with all other database
columns. The FORCEIN option can be used to relax this restriction.
However, a PC/IXF graphic column with IXFCSBCP not equal to zero,
or IXFCDBCP equal to zero, is an invalid data type, and cannot be
imported, even if FORCEIN is specified.
When importing a valid PC/IXF graphic column into a database graphic column, the value of IXFCDBCP must equal the DBCS CPGID of the target database column (that is, the double-byte code pages of the two columns must agree).
- If, during import of a PC/IXF file into an existing database table, a fixed-length string column (CHAR or GRAPHIC) is selected whose length is greater than the maximum length of the target column, the columns are incompatible.
- If, during import of a PC/IXF file into an existing database table, a variable-length string column (VARCHAR, LONG VARCHAR, VARGRAPHIC, or LONG VARGRAPHIC) is selected whose length is greater than the maximum length of the target column, the columns are compatible. Individual values are processed according to the compatibility rules governing the database manager INSERT statement, and PC/IXF values which are too long for the target database column are invalid.
- PC/IXF values imported into a fixed-length database character column (that is, a CHAR column) are padded on the right with single-byte spaces (0x20), if necessary, to obtain values whose length equals that of the database column. PC/IXF values imported into a fixed-length database graphic column (that is, a GRAPHIC column) are padded on the right with double-byte spaces (0x8140), if necessary, to obtain values whose length equals that of the database column.
- Since PC/IXF VARCHAR columns have a maximum length of 254 bytes, a database VARCHAR column of maximum length n, with 254 n 4001, must be exported into a PC/IXF LONG VARCHAR column of maximum length n.
- Although PC/IXF LONG VARCHAR columns have a maximum length of 32 767 bytes, and database LONG VARCHAR columns have a maximum length restriction of 32 700 bytes, PC/IXF LONG VARCHAR columns of length greater than 32 700 bytes (but less than 32 768 bytes) are still valid, and can be imported into database LONG VARCHAR columns, but data might be lost.
- Since PC/IXF VARGRAPHIC columns have a maximum length of 127 bytes, a database VARGRAPHIC column of maximum length n, with 127 n 2001, must be exported into a PC/IXF LONG VARGRAPHIC column of maximum length n.
- Although PC/IXF LONG VARGRAPHIC columns have a maximum length of 16 383 bytes, and database LONG VARGRAPHIC columns have a maximum length restriction of 16 350, PC/IXF LONG VARGRAPHIC columns of length greater than 16 350 bytes (but less than 16 384 bytes) are still valid, and can be imported into database LONG VARGRAPHIC columns, but data might be lost.
PC/IXF COLUMN DATA TYPE | DATABASE COLUMN DATA TYPE | |||||
---|---|---|---|---|---|---|
SMALL INT | INT | BIGINT | DEC | DFP | FLT | |
-SMALLINT | N | |||||
E | E | E | Ea | E | E | |
-INTEGER | N | |||||
Ea | E | E | Ea | E | E | |
-BIGINT | N | |||||
Ea | Ea | E | Ea | E | E | |
-DECIMAL | N | |||||
Ea | Ea | Ea | Ea | E | E | |
-DECFLOAT | N | |||||
Ea | Ea | Ea | Ea | E | Ea | |
-FLOAT | N | |||||
Ea | Ea | Ea | Ea | E | E |
PC/IXF COLUMN DATA TYPE | DATABASE COLUMN DATA TYPE | ||||||
---|---|---|---|---|---|---|---|
(0,0) | (SBCS, 0)d | (SBCS, DBCS)b | GRAPHb | DATE | TIME | TIME STAMP | |
-(0,0) | N | ||||||
E | Ec | Ec | Ec | ||||
-(SBCS,0) | N | N | |||||
E | E | E | Ec | Ec | Ec | ||
-(SBCS, DBCS) | N | Ec | Ec | Ec | |||
E | E | ||||||
-GRAPHIC | N | ||||||
E | E | ||||||
-DATE | N | ||||||
E | |||||||
-TIME | N | ||||||
E | |||||||
-TIME STAMP | N | ||||||
E |
c Individual values are rejected if they are not valid date or time values.
d Data type is not available in DBCS environments.
- The table is a matrix of all valid PC/IXF and database manager data types. If a PC/IXF column can be imported into a database column, a letter is displayed in the matrix cell at the intersection of the PC/IXF data type matrix row and the database manager data type matrix column. An 'N' indicates that the utility is creating a new database table (a database column of the indicated data type is created). An 'E' indicates that the utility is importing data to an existing database table (a database column of the indicated data type is a valid target).
- Character string data types are distinguished by code page attributes.
These attributes are shown as an ordered pair (SBCS,DBCS), where:
- SBCS is either zero or denotes a non-zero value of the single-byte code page attribute of the character data type
- DBCS is either zero or denotes a non-zero value of the double-byte code page attribute of the character data type.
- If the table indicates that a PC/IXF character column can be imported into a database character column, the values of their respective code page attribute pairs satisfy the rules governing code page equality.