-
-
Notifications
You must be signed in to change notification settings - Fork 293
/
v.db.renamecolumn.html
49 lines (38 loc) · 1.67 KB
/
v.db.renamecolumn.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<h2>DESCRIPTION</h2>
<em>v.db.renamecolumn</em> renames a column in the attribute table connected
to a given vector map. It automatically checks the connection for the specified
layer.
<h2>NOTES</h2>
If the map table is connected through the DBF or SQLite drivers, the renaming
is internally done by adding a new column with new name, transferring the contents
of the old column to the new column and dropping the old column. This is needed
as DBF or SQLite do not support "ALTER TABLE" command to rename columns. Due to
this the renamed column is found as last column of the table, it's original position
cannot be maintained.
<p>The SQLite driver will exit with an error if the column rename involves only a change of
case, i.e., upper-to-lowercase, or lower-to-uppercase. The SQLite protocol considers "NAME"
and "name" to be identical column names. In cases like these, the user should rename the original
column to an intermediary name, then rename the intermediary to the final name.
<h2>EXAMPLES</h2>
Renaming a column:<br>
<div class="code"><pre>
g.copy vect=roadsmajor,myroads
v.info -c myroads
v.db.renamecolumn myroads column=ROAD_NAME,roadname
v.info -c myroads
</pre></div>
<h2>SEE ALSO</h2>
<em>
<a href="db.execute.html">db.execute</a>,
<a href="v.db.addcolumn.html">v.db.addcolumn</a>,
<a href="v.db.addtable.html">v.db.addtable</a>,
<a href="v.db.connect.html">v.db.connect</a>,
<a href="v.db.dropcolumn.html">v.db.dropcolumn</a>,
<a href="v.db.droptable.html">v.db.droptable</a>,
<a href="v.db.select.html">v.db.select</a>,
<a href="v.db.update.html">v.db.update</a><br>
<a href="sql.html">GRASS SQL interface</a>
</em>
<h2>AUTHOR</h2>
Markus Neteler
<p><i>Last changed: $Date$</i>