[Qgis-user] SQL display expression

Christoph Lauber christoph.lauber at geoplanteam.ch
Tue May 10 05:23:30 PDT 2016


Hi

 

I have a question about the display expression for forms.  The aim is to
show data of a table that is not related by QGIS.

 

What I would like to do is to write a SQL to my SpatiaLite database to fetch
some data. I suppose, that the display expression is restricted to the
“select column” clause like: “"pkuid"   ||  ' '  || CASE WHEN art = 1 THEN
'this' ELSE 'that' END”. When I put a select clause in it like “CASE WHEN
"art" THEN (SELECT value FROM WI_D_Inventar_Art WHERE id = "art") ELSE
'Undefined' END” I get an expression is invalid error (the expression works
in spatialite_gui). It seems that the SELECT keyword is not accepted.

 

Is there any possibility to write “free” SQL-Syntax for the display
expression?

 

I wrote already a function that connects to the database, fetchs the data
and closes the database. It works, but it is slow.

 

Thanks for your help.

 

Freundliche Grüsse

Christoph Lauber

 

*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*
GeoplanTeam AG dipl. Ing. ETH/SIA Hutzli+Kluser
Vermessung | Geoinformatik | Umwelttechnik
Egliweg 6, CH - 2560 Nidau
Phone:(+41) - 032 332 78 00
Fax:(+41) - 032 332 78 01
Web:  <http://www.geoplanteam.ch/> www.geoplanteam.ch
E-Mail:  <mailto:christoph.lauber at geoplanteam.ch>
christoph.lauber at geoplanteam.ch
*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20160510/292c6f34/attachment.html>


More information about the Qgis-user mailing list