IBM Support

SQL3525N CODEPAGE option is incompatible with the LOBSINFILE option during IMPORT

Question & Answer


Question

When you import large object (LOB) data specifying the LOBSINFILE file type modifier, the server code page must be the same as the database code page; otherwise, an SQL3525N error is returned: the CODEPAGE option is incompatible with the LOBSINFILE option. This problem first appears in DB2 UDB Version 8.1 FixPak 9 (also known as DB2 UDB Version 8.2 FixPak 2). Because the IXF file format remembers whether the LOBSINFILE modifier and the CODEPAGE modifier were specified during data export, these file type modifiers do not have to be explicitly specified during import for this error to be returned.

Cause

If the application code page is different than the database code page, code page conversion occurs during an import operation. The import utility expects data in the application code page, which can be changed by specifying the MODIFIED BY CODEPAGE clause on the IMPORT command.

(The CODEPAGE modifier is not allowed for the IXF file format, because IXF files 'remember' the data code page).

However, because the LOBSINFILE and the CODEPAGE file type modifiers are not compatible, code page conversion of LOB data (when the LOBSINFILE modifier has been specified) is not supported.

Answer

You can use one of the following workarounds:

  • Make the application code page the same as the database code page:
    1. Determine the database code page:
      db2 get db cfg for wsdbxml
      ...
      Database code page = 1208
      ...
    2. Change the application code page in one of two ways:
      1. This change affects all sessions:
        db2set db2codepage=1208
        db2start
        db2stop
      2. This change affects only the current session and should be done before connecting to the database:
        export DB2CODEPAGE=1208
  • Use the DB2 load utility.
    If your IMPORT command is:
    import from myfile.ixf of ixf replace into mytable
    ... you can use:
    load from myfile.ixf of ixf modified by codepage=1208 replace into mytable
  • Use inline LOBs; that is, export the data again without specifying the LOBSINFILE modifier:
    export to myfile.ixf of ixf modified by codepage=1208 select * from mytable
    import from myfile.ixf of ixf replace into mytable2

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Movement - Import","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8","Edition":"Enterprise;Personal;Workgroup;Express","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21220689