[GRASSLIST:5202] Re: db.select problem

grit grit.schuster at geographie.uni-freiburg.de
Tue Dec 21 05:41:07 EST 2004


Hello everyone,

thanks very much for your hints.
Installing the CVS solved my problem!
So the queries are working fine now!

Cheers,
Grit

Michael Barton wrote:

>I reported a similar problem from the GUI last week. I understand it was
>subsequently fixed in the CVS.
>
>Michael
>
>
>On 12/16/04 8:03 AM, "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
>>
>>I tried to use the "input=filename" option with the same statement. But in
>>this case all records
>>of the table are selected.
>>
>>I just don't understand it :-(
>>
>>Grit
>>
>>
>>
>>
>>
>>
>>
>>
>>Stephan Holl wrote:
>>
>>    
>>
>>>Hello grit, 
>>>
>>>On Thu, 16 Dec 2004 14:10:58 +0100 grit
>>><grit.schuster at geographie.uni-freiburg.de> wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Hello,
>>>>
>>>>could anybody please give me an idea about what I'm doing wrong?
>>>>I'm running db.select on the grass prompt with
>>>>
>>>>db.select table=corinelandcover sql='select * from corinelandcover
>>>>where BEREICH_NR=3 and GRUPPE_NR=31 and ART_NR=311'
>>>>
>>>>
>>>>Running the same sql query on db.select interative the following lines
>>>>are printed:
>>>>
>>>>db.select driver=dbf table=corinelandcover sql='select * from
>>>>corinelandcover where BEREICH_NR=3 and GRUPPE_NR=31 and ART_NR=311'
>>>>fs=|| vs=-- nv=NULL input=/home/grit/sqlstatement
>>>>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
>>>>   
>>>>
>>>>        
>>>>
>>>Have you tried another syntax?
>>>
>>>This should do:
>>>echo "SELECT * FROM corinelandcover WHERE BEREICH_NR=3 AND GRUPPE_NR=31
>>>AND ART_NR=311"|db.select
>>>
>>>
>>>Make sure, that the table is existent in your location/mapset/dbf-folder
>>>
>>>Cheers
>>>Stephan
>>>
>>>
>>> 
>>>
>>>      
>>>
>
>____________________
>C. Michael Barton, Professor of Anthropology
>School of Human Evolution and Social Change
>PO Box 872402
>Arizona State University
>Tempe, AZ  85287-2402
>USA
>
>Phone: 480-965-6262
>Fax: 480-965-7671
>www: <www.public.asu.edu/~cmbarton>
>
>
>  
>




More information about the grass-user mailing list