Hi All,

In a similar vein to my previous posts about carriage returns in values in a database, I now have an issue with quotes (ie: ")

It seems that the csv output from SQLite has a major problem/error. Within CSV format, a quote should be returned as a double quote, within quotes. For example, if I have a field containing:

I said "Hi there"

then the CSV representation should be:

"I said ""Hi there"""

but sqlite seems to just return:

"I said "Hi there""

which is ambiguous for data processing, and certainly causes errors in any standard CSV parsing routine.

To test it, you can do this, via the sqlite3 command line:

CREATE TABLE Test( field1 );
INSERT INTO "Test" VALUES('I said "Hi there"');
.mode csv
SELECT * FROM Test;

gives:
"I said "Hi there""

So, my questions are:

1. Is this a known bug in SQLite's csv output? Will it be fixed?

2. Is there another way to reliably get the contents of a database via the command line? It must handle values containing pipes, quotes, commas, carriage returns etc.

Thanks,
Tom


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to