[gdal-dev] OGR SQL: Excecuting select where column name contains "."

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Fri Oct 5 04:30:09 PDT 2012


Odd Ragnar Lydersen <Odd-Ragnar.Lydersen <at> powel.no> writes:

> 
> When I use single quotes, I get no errors, but instead I get returned the
column name = FIELD_1, and all values
> = column.name.one
> I'm using the ExecuteSql() on a WFS datasource, so it might be the WFS driver
which causes the undesired

I believe that . (dot) will not work in -sql in any place even it perhaps should.

I made a small test feature type "dot.test" and the following is listing it
>ogrinfo WFS:http://188.64.1.61/cgi-bin/tinyows

This works too 
>ogrinfo WFS:http://188.64.1.61/cgi-bin/tinyows dot.test

But this does not work
>ogrinfo WFS:http://188.64.1.61/cgi-bin/tinyows -sql "select code_reg from dot.test"

The result is
ERROR 1: SQL Expression Parsing Error: syntax error

In my opinion using dots in feature type or field names is an intentional call
for troubles but unfortunately -sql parameter seems to have troubles also with
colons.

This works for me
>ogrinfo WFS:http://188.64.1.61/cgi-bin/tinyows -sql "select code_reg from france"

This should definitely work too, but it does not
>ogrinfo WFS:http://188.64.1.61/cgi-bin/tinyows -sql "select code_reg from tows:
france"
INFO: Open of `WFS:http://188.64.1.61/cgi-bin/tinyows'
      using driver `WFS' successful.
ERROR 1: SQL Expression Parsing Error: syntax error


Tested with GDAL build from September 27th on Windows 7.

-Jukka Rahkonen-



More information about the gdal-dev mailing list