[Gvsig_english] Sql language in the shapefile filter

Marcus C. England marcuscengland at gmail.com
Wed May 21 02:32:39 CEST 2008


I was just now able to get it to work by using the "fips" code and no 
quotes around the attribute I want to select. Apparently you can't have 
quotes in your SQL syntax, but without the quotes I would get an error 
because of spaces between Los, Angeles and County.

In summation:

WHERE fips = 6037          WORKS

WHERE county = Los Angeles County           GETS AN ERROR THROWN BACK

Quotes do not work either.

Does anyone know a work-around that would allow the second one to work?

-Marcus


Francisco José Peñarrubia wrote:
> Hi.
>
> If you mean sql where clause when you open a Postgis layer, the 
> sentence should be "Postgress compliant". I don't know if you can use 
> county = 'Los Angeles County' but I think you can try county like 'Los 
> Angeles County'.
>
> Hope this helps.
>
> Cheers.
>
> Fran.
>
> Marcus C. England escribió:
>> Hi,
>>
>> I have a similar question... I can not get sql restriction to work. 
>> For example, I have a postgis database layer called 
>> "california_counties". This layer has an attribute column called 
>> "county" with the county names. In other programs I can load Los 
>> Angeles County only by using the sql statement:
>>
>> county = 'Los Angeles County'
>>
>> This does not work in gvSIG however. I always get a box that says:
>>
>> "syntax error at or near "=""
>>
>> I can't figure out what the problem is and I am hoping someone can help.
>>
>> -Marcus
>>
>>
>> silvio grosso wrote:
>>> Hello everybody,
>>> I am wondering if is it possible to write some simple query in the 
>>> filter using the SQL language?
>>>
>>> I read gvSIG's manual but I didn't find any example about that.
>>> At present , to select an area I should write: TOPONIMO = 'ASTI' in 
>>> order to get the selection.
>>> Nevertheless, in some cases SQL language is faster.
>>> For example, when I want to select  two areas in a shapefileI am 
>>> obliged to write two times the word TOPONIMO (e.g TOPONIMO = 'ASTI' 
>>> or TOPONIMO =  'Aglie'). When I want to select four or more 
>>> TOPONIMOS in the filter it becomes complicated.
>>>
>>> Best regards
>>>
>>> Silvio
>>>
>>>
>>>       ___________________________________ Scopri il Blog di Yahoo! 
>>> Mail: trucchi, novità, consigli... e la tua opinione!
>>> http://www.ymailblogit.com/blog/
>>>
>>> _______________________________________________
>>> Gvsig_internacional mailing list
>>> Gvsig_internacional at runas.cap.gva.es
>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>>
>>>   
>>
>> _______________________________________________
>> Gvsig_internacional mailing list
>> Gvsig_internacional at runas.cap.gva.es
>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>



More information about the Gvsig_internacional mailing list