[GRASS-user] alter table - sqlite

wqual wolfgang.qual at gmx.net
Thu Aug 10 11:35:47 EDT 2006


Hi Martin,
I am using GRASS 6.1.CVS, and it works with the following command
v.db.addcol map=block_extrakt columns="neu INT"

I did not specify layer in this command (but when I tried layer=1, I also got 
the same error message). However, you need not to specify the layer option, 
as

"v.db.addcol adds one or more column(s) to the attribute table connected to a 
given vector map. It automatically checks the connection for the specified 
layer." (see g.manual v.db.addcol for example). Additionally, the "layer"-tag 	
needs to be written before the columns-tag. 

I hope that this might help you.

Am Donnerstag 10 August 2006 pH:07:17 nachmittags/abends schrieb Martin 
Rutzinger:
> 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
>
>
> _______________________________________________
> grassuser mailing list
> grassuser at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grassuser




More information about the grass-user mailing list