<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Century Gothic";
        panose-1:2 11 5 2 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Century Gothic",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-CH link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif'>Hi<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif'>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.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif'>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: “"<i>pkuid"   ||  ' '  || CASE WHEN art = 1 THEN 'this' ELSE 'that' END</i>”. When I put a select clause in it like “<i>CASE WHEN "art" THEN (<b>SELECT</b> value FROM WI_D_Inventar_Art WHERE id = "art") ELSE 'Undefined' END</i>” I get an expression is invalid error (the expression works in spatialite_gui). It seems that the SELECT keyword is not accepted.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>Is there any possibility to write “free” SQL-Syntax for the display expression?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>I wrote already a function that connects to the database, fetchs the data and closes the database. It works, but it is slow.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>Thanks for your help.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>Freundliche Grüsse</span><span style='mso-fareast-language:DE-CH'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>Christoph Lauber<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:DE-CH'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*<br>GeoplanTeam AG dipl. Ing. ETH/SIA Hutzli+Kluser<br>Vermessung | Geoinformatik | Umwelttechnik<br>Egliweg 6, CH - 2560 Nidau<br>Phone:(+41) - 032 332 78 00<br>Fax:(+41) - 032 332 78 01<br>Web: </span><span style='mso-fareast-language:DE-CH'><a href="http://www.geoplanteam.ch/"><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;color:blue'>www.geoplanteam.ch</span></a><br></span><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>E-Mail: </span><span style='mso-fareast-language:DE-CH'><a href="mailto:christoph.lauber@geoplanteam.ch"><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;color:blue'>christoph.lauber@geoplanteam.ch</span></a><br></span><span style='font-size:10.0pt;font-family:"Century Gothic",sans-serif;mso-fareast-language:DE-CH'>*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>