## NAME

v.db.update

## DESCRIPTION

v.db.update allows to assign a new value to a column in the attribute table connected to a given map. Alternatively, values can be copied from another column in the table.

## NOTES

v.db.update is just a front-end to db.execute to allow easier usage. For complex SQL UPDATE statements, db.execute should be used.

## EXAMPLES

Spearfish: adding new column, inserting selectively a specified value:

    g.copy vect=fields,myfields
    v.db.addcol myfields col="polynum integer"
    v.db.update myfields col=polynum val=42 where="label='V. White#1'"
    v.db.select myfields

Spearfish: adding new column, copying values from other table column with on the fly calculation:

    g.copy vect=fields,myfields
    v.db.addcol myfields col="polynum integer"
    v.db.update myfields col=polynum qcol="cat*2"
    v.db.select myfields

Type cast (type conversion) of strings to double precision (unsupported by DBF driver):

    v.db.update mygeodetic_pts col=zval qcol="CAST(z_value AS double precision)" \
                where="z_value <> 'N/A'"

## SEE ALSO

db.execute, v.db.addcol, v.db.addtable, v.db.connect, v.db.droptable, v.db.join, v.db.select
GRASS SQL interface

## AUTHOR

Moritz Lennert (mlennert@club.worldonline.be)

Last changed: $Date: 2007-06-29 09:51:12 +0200 (Fri, 29 Jun 2007) $

Main index - vector index - Full index

© 2003-2010 GRASS Development Team