Thanks for this quick reply :)

On 11/13/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

Florent THIERY <[EMAIL PROTECTED]> wrote:
> Some files have optional fields, so what i'd like to do is, whenever
> such a file is scanned and parsed, i want my software to
> - check first if the column already exists; that, i have no idea how
> to achieve it

PRAGMA table_info: http://sqlite.org/pragma.html#schema


I don't quite get how to use these commands to do a trivial presence test

If i query something like:
" select * from jpgs where "/sof/field1/nb_comp" != NULL "

What result would i get if the column doesn't exist yet?


I read something about vaccuming the table? What about it?

You can't vacuum a table, you can vacuum an entire database. VACCUUM
command cleans up free space possibly left after deleted records, making
DB file smaller. It should be noted that this free space will eventually
be used by new records, but for some usage patterns it may still be
useful to vacuum (e.g. the application usually keeps a small amount of
data, but it has spikes where it adds a large number of records then
deletes most of them).




In any case, I don't quite see how this is related to the issue of
determining the existence of a column.


from http://www.sqlite.org/lang_altertable.html

" After ADD COLUMN has been run on a database, that database will not be
readable by SQLite version 3.1.3 and earlier until the database is
VACUUM<http://www.sqlite.org/lang_vacuum.html>ed.
"

Is it mandatory then?

Reply via email to