[GRASSLIST:5179] Re: db.select problem

Hamish hamish_nospam at yahoo.com
Thu Dec 16 17:55:28 EST 2004


On Thu, 16 Dec 2004 16:03:21 +0100
grit <grit.schuster at geographie.uni-freiburg.de> wrote:

> Thanks Stephan!
> 
> this works fine using the grass prompt:
> 
> db.select table=corinelandcover sql='select * from corinelandcover
> where BEREICH_NR=3 and GRUPPE_NR=31 and ART_NR=311'
> 
> echo "SELECT * FROM corinelandcover WHERE BEREICH_NR=3 AND GRUPPE_NR=31
> AND ART_NR=311"|db.select
> 
> 
> 
> 
> But, trying to run the same sql statement through the interactive db.select 
> user interface does end with an error: 
> 
> db.select driver=dbf table=corinelandcover sql=echo"SELECT * FROM corinelandcover WHERE BEREICH_NR=3 AND GRUPPE_NR=31 AND ART_NR=311" fs=|| vs=-- nv=NULL
> Sorry <*> is not a valid option
> Sorry <FROM> is not a valid option
> Sorry <corinelandcover> is not a valid option
> Sorry <WHERE> is not a valid option
> Sorry, <BEREICH_NR> is not a valid parameter
> Sorry <AND> is not a valid option
> Sorry, <GRUPPE_NR> is not a valid parameter
> Sorry <AND> is not a valid option
> Sorry, <ART_NR> is not a valid parameter


In the tcltk GUI you should:
 - leave off the quoting around the whole statement
 - don't use "echo"

I think fs= and vs= might have to be single chars?

Hamish




More information about the grass-user mailing list