v.db.addtable.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <h2>DESCRIPTION</h2>
  2. <em>v.db.addtable</em> creates and adds a new attribute table to a given vector
  3. map. It links the table to the specified layer of the vector map. If the vector
  4. map is not yet linked to any table, new a database link is established based on
  5. the MAPSET database settings (see <em>db.connect</em>).
  6. <h2>NOTES</h2>
  7. <em>v.db.addtable</em> is a front-end to <em>db.execute</em> to allow easier
  8. usage.
  9. v.db.addtable will only insert category values into the table for those features
  10. which actually have a category value in the relevant layer. The use can add
  11. category values automatically by using <em>v.category</em> or manually with
  12. <em><a href="wxGUI.Vector_Digitizing_Tool.html">wxGUI vector digitizer</a></em> before running v.db.addtable. Or one can run v.db.addtable first
  13. and then use either a combinatino of <em>v.category</em> + <em>v.to.db</em> or
  14. <em><a href="wxGUI.Vector_Digitizing_Tool.html">wxGUI vector digitizer</a></em> to add the relevant lines to the table.
  15. The supported types of columns depend on the database backend. However, all
  16. backends should support VARCHAR, INT, DOUBLE PRECISION and DATE. The default
  17. dbf backend supports only these types.
  18. The existing database connection(s) can be verified with <em>v.db.connect</em>.
  19. <h2>EXAMPLE</h2>
  20. Adding a new attribute table with a single column to default layer 1:<br>
  21. <div class="code"><pre>
  22. v.db.addtable sentiero_brenta_points columns="slope double precision"
  23. v.db.connect -p sentiero_brenta_points
  24. v.info -c sentiero_brenta_points
  25. </pre></div>
  26. <p>
  27. Adding a new attribute table with two columns to layer 2:<br>
  28. <div class="code"><pre>
  29. v.db.addtable sentiero_brenta_points columns="slope double precision,myname varchar(15)" layer=2
  30. v.db.connect -p sentiero_brenta_points
  31. v.info -c sentiero_brenta_points
  32. </pre></div>
  33. <h2>SEE ALSO</h2>
  34. <em><a HREF="db.connect.html">db.connect</a></em>,
  35. <em><a HREF="db.droptable.html">db.droptable</a></em>,
  36. <em><a HREF="db.execute.html">db.execute</a></em>,
  37. <em><a HREF="v.category.html">v.category</a></em>,
  38. <em><a HREF="v.db.addcolumn.html">v.db.addcolumn</a></em>,
  39. <em><a HREF="v.db.connect.html">v.db.connect</a></em>,
  40. <em><a HREF="v.db.dropcolumn.html">v.db.dropcolumn</a></em>,
  41. <em><a HREF="v.db.droptable.html">v.db.droptable</a></em>,
  42. <em><a HREF="v.db.select.html">v.db.select</a></em>,
  43. <em><a HREF="v.db.update.html">v.db.update</a></em><br>
  44. <em><a href="sql.html">GRASS SQL interface</a></em>
  45. <h2>AUTHOR</h2>
  46. Markus Neteler
  47. <p>
  48. <i>Last changed: $Date$</i>