[GRASS-user] v.db.addcol error

Hallo Grass'ers

I am having trouble with v.db.addcol. My vector has 315 discrete polygons (sample plots for LiDAR and MX data). I would like to add a column and populate it with numbers running from 1 - 315.

db.connect -p returns the following data

###########################################################################
GRASS 6.2.3 (Paper4):~/paper4-data/work/sampling > db.connect -p
driver:dbf
database:$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
schema:(null)
group:(null)
###########################################################################

and when I execute v.db.addcol I get the following error

###########################################################################
GRASS 6.2.3 (Paper4):~/paper4-data/work/sampling > v.db.addcol map=Flight_line2_clean layer=1 column="ID,INT"
DBMI-DBF driver error:
SQL parser error in statement:
ALTER TABLE Flight_line2_clean ADD COLUMN ID

Error in db_execute_immediate()

ERROR: Error while executing: "ALTER TABLE Flight_line2_clean ADD COLUMN ID
       "
ERROR: Cannot continue (problem adding column).
###########################################################################

I have tried various combinations of the "column" variable as this is where I think the problem lies. I would like the column name to be ID and it to contain INTEGER values.

Could someone please suggest a solution

Many thanks and looking forward to your help and support,
Wesley

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.

Hi,

2008/8/22 Wesley Roberts <wroberts@csir.co.za>:

GRASS 6.2.3 (Paper4):~/paper4-data/work/sampling > v.db.addcol map=Flight_line2_clean layer=1 column="ID,INT"
DBMI-DBF driver error:
SQL parser error in statement:
ALTER TABLE Flight_line2_clean ADD COLUMN ID

Error in db_execute_immediate()

ERROR: Error while executing: "ALTER TABLE Flight_line2_clean ADD COLUMN ID
      "
ERROR: Cannot continue (problem adding column).

comma is used as column definition delimiter, to add one column use

v.db.addcol map=Flight_line2_clean layer=1 column="ID int"

to add more columns, e.g.

v.db.addcol map=Flight_line2_clean layer=1 column="ID1 int, label varchar(255)"

Cheers, Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *