[GRASS-user] Problem importing TauDEM shapefile

Hi
When I try to import TauDEM shape file I recive the eror:

create table a (cat integer, LINKNO integer, DSLINKNO integer, USLINKNO1 integer, USLINKNO2 integer, DSNODEID double precision, Order integer, Length double precision, Magnitude integer, DS_Cont_Ar double precision, Drop double precision, Slope double precision, Straight_L double precision, US_Cont_Ar double precision, WSNO integer, DOUT_END double precision, DOUT_START double precision, DOUT_MID double precision)
Error in db_execute_immediate()

What wrong is in the table definition???

Jarek

2009/3/28 Jarek Jasiewicz <jarekj@amu.edu.pl>:

Hi
When I try to import TauDEM shape file I recive the eror:

create table a (cat integer, LINKNO integer, DSLINKNO integer, USLINKNO1
integer, USLINKNO2 integer, DSNODEID double precision, Order integer, Length
double precision, Magnitude integer, DS_Cont_Ar double precision, Drop
double precision, Slope double precision, Straight_L double precision,
US_Cont_Ar double precision, WSNO integer, DOUT_END double precision,
DOUT_START double precision, DOUT_MID double precision)
Error in db_execute_immediate()

What wrong is in the table definition???

(did you copy the entire error? If yes, you seem to use an older GRASS
version)

In GRASS 6.4, I get:

echo "create table a (cat integer, LINKNO integer, DSLINKNO integer,
USLINKNO1 integer, USLINKNO2 integer, DSNODEID double precision, Order
integer, Length double precision, Magnitude integer, DS_Cont_Ar double
precision,Drop double precision, Slope double precision, Straight_L
double precision, US_Cont_Ar double precision, WSNO integer, DOUT_END
double precision, DOUT_START double precision, DOUT_MID double
precision)" | db.execute
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected ORDER, expecting NAME
processing 'Order'
in statement:
create table a (cat integer, LINKNO integer, DSLINKNO integer,
USLINKNO1 integer, USLINKNO2 integer, DSNODEID double precision, Order
integer, Length double precision, Magnitude integer, DS_Cont_Ar double
precision, Drop double precision, Slope double precision,
Straight_Ldouble precision, US_Cont_Ar double precision, WSNO integer,
DOUT_END double precision, DOUT_START double precision, DOUT_MID
double precision)

Error in db_execute_immediate()

ERROR: Error while executing: 'create table a (cat integer, LINKNO integer,
...

One column is called "Order" which is a reserved SQL word. Please use
a different
column name.
If this is v.in.ogr, there is the cnames option to rename on the fly
during import.

Markus

Rename columns Order and Drop during import. Reserved words may differ
from one database to other, still I suggest to take a look at MySQL
reserved word list that may help to avoid such problem in future:
http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords-5-0.html

WBR,
Maris.

2009/3/28 Jarek Jasiewicz <jarekj@amu.edu.pl>:

Hi
When I try to import TauDEM shape file I recive the eror:

create table a (cat integer, LINKNO integer, DSLINKNO integer, USLINKNO1
integer, USLINKNO2 integer, DSNODEID double precision, Order integer, Length
double precision, Magnitude integer, DS_Cont_Ar double precision, Drop
double precision, Slope double precision, Straight_L double precision,
US_Cont_Ar double precision, WSNO integer, DOUT_END double precision,
DOUT_START double precision, DOUT_MID double precision)
Error in db_execute_immediate()

What wrong is in the table definition???

Jarek
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user