[GRASS5] Re: [bug #3368] (grass) v.db.addcol manual - what column

Glynn Clements glynn at gclements.plus.com
Mon Jun 27 06:06:20 EDT 2005


Moritz Lennert wrote:

> I agree. Radim could you list the available types in the dbf driver,
> or give me a pointer where I can find them, so that I can add the
> list to the man page (and maybe even to the module itself) ?

The allowable column types are VARCHAR, INT, DOUBLE and DATE.

The clauses for parsing a CREATE TABLE statement are in
lib/db/sqlp/yac.y:

y_create:
		CREATE TABLE y_table '(' y_columndefs ')'	{ sqpCommand(SQLP_CREATE); }
	;
	
y_columndefs:
		y_columndef
	|	y_columndefs ',' y_columndef
	;

y_columndef:
		NAME VARCHAR '(' INTNUM ')'	{ sqpColumnDef( $1, SQLP_VARCHAR, $4, 0 ); }
	|	NAME INT 			{ sqpColumnDef( $1, SQLP_INTEGER,  0, 0 ); }
	|	NAME INTEGER 			{ sqpColumnDef( $1, SQLP_INTEGER,  0, 0 ); }
	|	NAME DOUBLE			{ sqpColumnDef( $1, SQLP_DOUBLE,   0, 0 ); }
	|	NAME DOUBLE PRECISION		{ sqpColumnDef( $1, SQLP_DOUBLE,   0, 0 ); }
	|	NAME DATE			{ sqpColumnDef( $1, SQLP_DATE,     0, 0 ); }
	;

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list