db2

Read in a file that contains multimple "CLOB" formatted data fields


Reading in a file that contains multiple "CLOB" formatted data fields (fields are formatted text values up to 32K bytes in size). The text includes end of line characters, so our standard import wizards get confused and think that they've reached the end of line and start importing the next record.

  1. option is to remove the EOL characters within the text, then import the data.

Is any additional methods to get this to work, in a DB2 system?


Solution

  • You will need to find a character that is never part of your data fields. Let's suppose the caret symbol is never there, so you can use it as the field delimiter. You will need to place it around each data field, then try importing it specifying the following modifiers: modified by chardel^ delprioritychar, this way the new line symbols that fall inside a pair of carets will be ignored when searching for the end of record.

    If your import wizard does not allow you to specify the modifiers, you'll need to run the DB2 IMPORT command manually.