Taj Morton wrote:
> Hi All,
> First off, I've been using SQLite in an open-source POS (inventory)
> program and am quite happy with it. Thank you all developers and patch
> submitters!
>
> Now, I've got two questions.
> The first is that I have a column (company) in a customers table. The
> problem is that this column has a comma in it for some rows. For
> example:
>
> sqlite> select lastname,business FROM customers WHERE id=449;
> Toleser|St Lawrence University, Biology Dept.
>
> Now, that's all fine and everything for interactive SQL, but when I'm
> using this in a program (written in Delphi), the comma messes up the
> returned values (since they are comma seperated). So, the Delphi
> interface ends up returning:
> Toleser|St Lawrence University|Biology Dept.
>
> That's no good :(. Does anyone have any suggestions on what to do
> about this problem? I'm using SQLite 2.8.15.

If the Delphi interface handles quoted strings in the CSV data then you can
quote the columns that may contain commas. Use something like this:

SELECT lastname, '"' || bussiness || '"' FROM customers ...

The || operator is the concatenation operator. This adds double quotes
around all the bussiness name strings.

> As for my question about temporary tables: How long does SQLite keep
> the temporary tables around? Only for 1 query? Or until the table
> hasn't
> been modified for X amount of time? Or something I haven't thought of
> yet...
>

Temporary tables are destroyed when the database connection is closed or
when the user explicitly drops them.

I hope this helps.

Dennis Cote

Reply via email to