When moving delimited ASCII (DEL) files, it is important to ensure that the data being moved is not unintentionally altered because of problems with delimiter character recognition. To help prevent these errors, DB2® enforces several restrictions and provides a number of file type modifiers.
There are a number of restrictions in place that help prevent the chosen delimiter character from being treated as a part of the data being moved. First, delimiters are mutually exclusive. Second, a delimiter cannot be binary zero, a line-feed character, a carriage-return, or a blank space. As well, the default decimal point (.) cannot be a string delimiter. Finally, in a DBCS environment, the pipe (|) character delimiter is not supported.
db2 load from ... modified by chardel0x0C coldelX1e ...
By default, for character-based fields of a DEL file, any instance of the character delimiter found within the field is represented by double character delimiters. For example, assuming that the character delimiter is the double quote, if you export the text I am 6" tall., the output text in the DEL file reads "I am 6"" tall." Conversely, if the input text in a DEL file reads "What a ""nice"" day!", the text is imported as What a "nice" day!
nodoubledel
Double
character delimiter behavior can be disabled for the import, export,
and load utilities by specifying the nodoubledel file
type modifier. However, be aware that double character delimiter behavior
exists in order to avoid parsing errors. When you use nodoubledel with
export, the character delimiter is not doubled if it is present in
character fields. When you use nodoubledel with import
and load, the double character delimiter is not interpreted as a literal
instance of the character delimiter.
nochardel
When
you use the nochardel file type modifier with export,
the character fields are not surrounded by character delimiters. When nochardel is
used import and load, the character delimiters are not treated as
special characters and are interpreted as actual data.
chardel
Other
file type modifiers can be used to manually prevent confusion between
default delimiters and the data. Thechardel file
type modifier specifies x, a single character,
as the character string delimiter to be used instead of double quotation
marks (as is the default).
coldel
Similarly,
if you wanted to avoid using the default comma as a column delimiter,
you could use coldel, which specifies x,
a single character, as the column data delimiter.
"Vincent <row delimiter> is a manager",<row delimiter>
would be interpreted as having two rows: Vincent,
and is a manager, since <row delimiter>
takes precedence over the character delimiter (").
Using delprioritychar gives the character delimiter
(") precedence over the row delimiter
(<row delimiter>), meaning that the
same DEL file would be interpreted (correctly) as having one row: Vincent
is a manager.