.TH v.db.addtable 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBv.db.addtable\fR\fR - Creates and connects a new attribute table to a given layer of an existing vector map. .SH KEYWORDS vector, database, attribute table .SH SYNOPSIS \fBv.db.addtable\fR .br \fBv.db.addtable help\fR .br \fBv.db.addtable map\fR=\fIname\fR [\fBtable\fR=\fIstring\fR] [\fBlayer\fR=\fIinteger\fR] [\fBcolumns\fR=\fIname type\fR[,\fIname type\fR,...]] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Parameters: .IP "\fBmap\fR=\fIname\fR" 4m .br Vector map for which to add new attribute table .IP "\fBtable\fR=\fIstring\fR" 4m .br Name of new attribute table (default: vector map name) .IP "\fBlayer\fR=\fIinteger\fR" 4m .br Layer where to add new attribute table .br Default: \fI1\fR .IP "\fBcolumns\fR=\fIname type[,\fIname type\fR,...]\fR" 4m .br Name and type of the new column(s) (types depend on database backend, but all support VARCHAR(), INT, DOUBLE PRECISION and DATE) .br Default: \fIcat integer\fR .PP .SH DESCRIPTION \fIv.db.addtable\fR creates and adds a new attribute table to a given vector map. It links the table to the specified layer of the vector map. If the vector map is not yet linked to any table, new a database link is established based on the MAPSET database settings (see \fIdb.connect\fR). .SH NOTES \fIv.db.addtable\fR is a front-end to \fIdb.execute\fR to allow easier usage. v.db.addtable will only insert category values into the table for those features which actually have a category value in the relevant layer. The use can add category values automatically by using \fIv.category\fR or manually with \fIwxGUI vector digitizer\fR before running v.db.addtable. Or one can run v.db.addtable first and then use either a combinatino of \fIv.category\fR + \fIv.to.db\fR or \fIwxGUI vector digitizer\fR to add the relevant lines to the table. The supported types of columns depend on the database backend. However, all backends should support VARCHAR, INT, DOUBLE PRECISION and DATE. .PP The existing database connection(s) can be verified with \fIv.db.connect\fR. .SH EXAMPLE Adding a new attribute table with a single column to default layer 1: .br \fC .DS .br g.copy vect=roadsmajor,myroads .br v.db.addtable myroads columns="slope double precision" .br v.db.connect \-p myroads .br v.info \-c myroads .br .DE \fR .PP Adding a new attribute table with two columns to layer 2: .br \fC .DS .br g.copy vect=roadsmajor,myroads .br v.db.addtable myroads columns="slope double precision, roadname varchar(15)" layer=2 .br v.db.connect \-p myroads .br v.info \-c myroads .br v.info \-c myroads layer=2 .br .DE \fR .SH SEE ALSO \fI db.connect, db.droptable, db.execute, v.db.addtable, v.db.connect, v.db.dropcol, v.db.droptable, v.db.select, v.db.update .br GRASS SQL interface \fR .SH AUTHOR Markus Neteler .PP \fILast changed: $Date: 2012-11-25 14:27:13 +0100 (Sun, 25 Nov 2012) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team