1v.db.update(1)                Grass User's Manual               v.db.update(1)
2
3
4

NAME

6       v.db.update   -  Allows  to update a column in the attribute table con‐
7       nected to a vector map.
8

KEYWORDS

10       vector, database, attribute table
11

SYNOPSIS

13       v.db.update
14       v.db.update help
15       v.db.update map=string  [layer=integer]  column=string   [value=string]
16       [qcolumn=string]   [where=string]   [--verbose]  [--quiet]
17
18   Parameters:
19       map=string
20           Vector map to edit the attribute table for
21
22       layer=integer
23           Layer to which the table to be changed is connected
24           Default: 1
25
26       column=string
27           Column to update
28
29       value=string
30           Value  to update the column with (varchar values have to be in sin‐
31           gle quotes, e.g. 'grass')
32
33       qcolumn=string
34           Column to query
35
36       where=string
37           WHERE conditions for update, without 'where' keyword (e.g. cat=1 or
38           col1/col2>1)
39

DESCRIPTION

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

NOTES

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

EXAMPLES

50       Spearfish: adding new column, inserting selectively a specified value:
51       g.copy vect=fields,myfields
52       v.db.addcol myfields col="polynum integer"
53       v.db.update myfields col=polynum val=42 where="label='V. White#1'"
54       v.db.select myfields
55
56
57       Spearfish: adding new column, copying values from  other  table  column
58       with on the fly calculation:
59       g.copy vect=fields,myfields
60       v.db.addcol myfields col="polynum integer"
61       v.db.update myfields col=polynum qcol="cat*2"
62       v.db.select myfields
63
64
65       Type cast (type conversion) of strings to double precision (unsupported
66       by DBF driver):
67       v.db.update mygeodetic_pts col=zval qcol="CAST(z_value AS double preci‐
68       sion)" \
69                   where="z_value <> 'N/A'"
70
71

SEE ALSO

73       db.execute,  v.db.addcol,  v.db.addtable, v.db.connect, v.db.droptable,
74       v.db.join, v.db.select
75       GRASS SQL interface
76

AUTHOR

78       Moritz Lennert (mlennert@club.worldonline.be)
79
80       Last changed: $Date: 2007-06-29 09:51:12 +0200 (Fri, 29 Jun 2007) $
81
82       Full index
83
84       © 2003-2008 GRASS Development Team
85
86
87
88GRASS 6.3.0                                                     v.db.update(1)
Impressum