Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

DB2-L - DB2-Unloads im CSV-Format

Subject:

Re: [DB2-L] - RE: DB2 Unload

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

DB2 List <db2-l@lists.idug.org>

Date:

2015.03.27 20:04:00


This has been discussed recently, also on IBM-Main.
Look here: https://listserv.ua.edu/cgi-bin/wa?A2=ind1502&L=ibm-main&F=&S=&P=563359

See 3rd paragraph.

In general, with CSV the values have to be quoted (at least char values),
because they may contain the separation character, and if they were not quoted,
this may lead to confusion. CSV allows that the quotes may be omitted, if there
are no separation characters inside the values (as it is the case with all
numeric values, of course), but it is OK to surround all values with quotes.
Quotes inside of (char) values have to be doubled.

Kind regards

Bernd



Am 27.03.2015 um 18:49 schrieb P.V.:
>
> The CSV format, when using double quotes (") as text delimiters, will double
> these delimiters when they are part of the text.
>
> So if the DB2 value starts and ends with a ", the CSV entry will start with a
> triple " and end with a triple ": the outer ones are the CSV text delimiters
> (not part of the content) while the two inner pairs each take 2 bytes but only
> represent a single ".
>
> That accounts for the two extra bytes, I would guess.
>
>
> --      P.V.

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie