v.db.renamecolumn.html 1.7 KB

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