SQL

From GRASS-Wiki
Revision as of 15:09, 17 March 2011 by Neteler (talk | contribs) (+Analysing SQL syntax errors/table import or copy problems)
Jump to navigation Jump to search

SQL support in GRASS GIS

GRASS 6 uses SQL for vector attribute management.


Analysing SQL syntax errors/table import or copy problems

Sometimes it happens that db.*, v.db.* or other SQL related commands fail. For example, with

 ERROR:  syntax error at or near "Offset"
 LINE 1: ...eatureDet varchar(254), Measure double precision, Offset dou...
                                                             ^
 WARNING: Unable to create table <hydro_pointEvent>
 WARNING: Copy table failed

How to fix that? Check out for

  • column name used more than one time;
  • column name has reserved SQL word (depends on DB backend, see SQL Reserved Words Checker to quickly find out if a name is reserved)