[GRASS-user] alter table - sqlite

Martin Rutzinger Martin.Rutzinger at uibk.ac.at
Thu Aug 10 11:07:25 EDT 2006


hi list!

i'm working with sqlite and i want to add a column to the table of 'vector1'. i
tried several possibilities (v.db.addcol, db.execute; double, real,...) but i
got always the same error:


e.g.
v.db.addcol map=vector1 columns="area_size REAL" layer=1

DBMI-SQLite driver error:
Error in sqlite3_prepare():
near "ALTER": syntax error

FEHLER: Error while executing: "ALTER TABLE vector1 ADD COLUMN
        area_size REAL
        "
ERROR: Cannot continue (problem adding column).


e.g.
echo "ALTER TABLE vector1 ADD COLUMN area_size DOUBLE PRECISION" | db.execute

DBMI-SQLite driver error:
Error in sqlite3_prepare():
near "ALTER": syntax error

FEHLER: Error while executing: "ALTER TABLE vector1 ADD COLUMN
        area_size DOUBLE PRECISION
        "

but: if i use the sqlitebrowser and execute the statement in the 'execute sql
tab' like this, it works(!):

ALTER TABLE vector1 ADD COLUMN area_size DOUBLE PRECISION


however, i need a solution adding a column using shell scripting & sqlite. what
do i wrong? has anybody had a similar problem?
thanks,
martin





More information about the grass-user mailing list