[GRASS-user] db.execute where condition

Markus Neteler neteler at osgeo.org
Mon Mar 7 12:59:47 EST 2011

On Sun, Mar 6, 2011 at 1:10 PM, frans-joost <fjboogert at gmail.com> wrote:
> Dear GRASS users,
> I have imported a table titled landuse_tabe with the db.in.ogr command.
> I want to do the following with the table:
> Add a column named FEATURE_ID
> and add values to the column.
> To add the values to the column I use:
> echo 'UPDATE landuse_table SET FEATURE_ID='1' WHERE

I suspect that '1' makes GRASS-DB interpret this values
as a string. What does

v.info -c landuse_table

say? If that is a numeric column, you need to specify 1 as number.

> FEATURE='Grazing_land'|db.execute driver=dbf database=$database

Additionally, you cannot have ' within ' quotes. Either you need to
escape them or use ".


More information about the grass-user mailing list