[GRASS-user] alter table - sqlite

Martin Rutzinger Martin.Rutzinger at uibk.ac.at
Thu Aug 10 12:09:49 EDT 2006


hi wolfgang!

i tried it also without the layer option, but this did not help. i also use
GRASS 6.1.CVS and SQLITE-CVS.
may be there is something wrong with SQLITE? which version of SQLITE is
supported/recommended to use with GRASS?

but thanks,
martin.


Zitat von wqual <wolfgang.qual at gmx.net>:

> 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