You're asking how to eliminate the comma (,
) in a comma separated values file? :-)
NOCHARDEL
tells DB2 not to surround character-fields (CHAR
and VARCHAR
fields) with a character-field-delimiter (default is the double quote "
character).
Anyway, when exporting from DB2 using the delimited format, you have to have some kind of column delimiter. There isn't a NOCOLDEL
option for delimited files.
The EXPORT
utility can't write fixed-length (positional) records - you would have to do this by either:
- Writing a program yourself,
- Using a separate utility (IBM sells the High Performance Unload utility)
- Writing an SQL statement that concatenates the individual columns into a single string:
Here's an example for the last option:
export to file.del
of del
modified by nochardel
select
cast(col1 as char(20)) ||
cast(intcol as char(10)) ||
cast(deccol as char(30));
This last option can be a pain since DB2 doesn't have an sprintf()
function to help format strings nicely.