[Qgis-user] Execute SQL

Herbert Lincon herbert_lincon_jau at hotmail.com
Tue Nov 6 13:11:28 PST 2018


Hello,



In QGIS 2.18.23, I´m using the model "Execute SQL" from the Tollbox to run the statment:

"SELECT * FROM input1 ORDER BY TALHAO ASC;"

​where "TALHAO" is the name of a colum with integer values.



My issue is:

I made a Model with several steps, and I need to put this SQL statment in the middle of it,

but this process never accept a output as input.

For example: if the "Execute SQL" is the first step, it will execute normally,

but if it is not the first one, I got this error:



Error executing algorithm Execute SQL

virtual: Cannot find layer OUTPUTALGQGISDISSOLVE1_shp20181015165259558

Searching in the %temp% folder, this output file do exist!



I made another attempt,

with the SQL as first step,

if the input shape is named starting with letter, it will run

if the input name´s starts with number, a got this error:



Error executing algorithm Execute SQL

virtual: Query execution error on DROP TABLE IF EXISTS "input1"; CREATE VIRTUAL TABLE "input1" USING QgsVLayer(81121_463_DE20181015165152041);: 1 - unrecognized token: "81121_463_DE20181015165152041"





I can´t understand why sometimes this algoritm run, and sometimes not

I would appreciate some help



Thanks for the Attention

______________________________________________
Herbert Lincon R. A. dos Santos


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20181106/b0f735ee/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sql.png
Type: image/png
Size: 13691 bytes
Desc: sql.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20181106/b0f735ee/attachment-0001.png>


More information about the Qgis-user mailing list