<div dir="ltr">Hello Enrico,<div>QGIS implements an older arrangement from the first version of Spatialite. The views share metadata with tables in geometry_columns.</div><div>I think that QGIS should use the proper metadata table as well. It's time to do it as Spatialite is at version 4 and the views_geometry_columns comes from version 2.4 or so. Probably it could handle both metadata for compatibility, after enforcing the wrong arrangement for years.</div><div>Anyhow, to solve your problem, just add an entry in geometry_columns.</div><div>c<br></div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 29, 2016 at 9:00 PM, Enrico Fiore wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Date: Thu, 29 Sep 2016 16:07:25 +0200 (CEST)<br>
From: Enrico Fiore <<a href="mailto:enricofiore@libero.it">enricofiore@libero.it</a>><br>
To: QGIS User List <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>><br>
Subject: [Qgis-user] QGIS 2.16 DB Manager and spatialite view<br>
Message-ID:<br>
        <<a href="tel:360816939" value="+39360816939">360816939</a>.108261475158045364.JavaMail.<wbr>defaultUser@defaultHost><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
<br>
I have created a database with spatialite_gui tool, the database has some spatial views created with a code like this<br>
<br>
CREATE VIEW comunitorino AS<br>
SELECT c.ROWID as rowid, c.cod_com, c.geometry<br>
from comuni c;<br>
<br>
INSERT INTO views_geometry_columns<br>
    (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column,read_only)<br>
  VALUES ('comunitorino', 'geometry', 'rowid', 'comuni', 'geometry',1)<br>
<br>
The view can be load in QGIS by 'add spatialite layer' button<br>
<br>
The problem is that if I use DB Manager and open the DB the view will not be seen as spatial view.<br>
<br>
If I create the view in DB Manger with the "Create a view" button the view will be seen as spatial view.<br>
<br>
Where is the mistake?<br>
<br>
Thanks<br>
<br>
Enrico<br></blockquote></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>--------------------------------------------------------------------------<br>Carlo A. Bertelli<br>   Charta servizi e sistemi per il territorio e la storia ambientale srl <br>          Dipendenze del palazzo Doria, <br>          vc. alla Chiesa della Maddalena 9/2 16124      Genova (Italy)<br>          tel./fax +39(0)10 2475439  +39 0108566195  gsm:+39 393 1590711<br>   e-mail: <a href="mailto:bertelli@chartasrl.eu" target="_blank">bertelli@chartasrl.eu</a>      <a href="http://www.chartasrl.eu" target="_blank">http://www.chartasrl.eu</a><br>--------------------------------------------------------------------------<br><br><br></div></div></div>
</div></div></div>