Open brusspi opened 3 years ago
@brusspi no of course, because with 'PostgreSQL execute SQL' you can run a queries against tables/layers that exist on a particular PostgreSQL endpoint, not a temp layer/table coming out of an algorithm in the QGIS modeller on your computer.
@gioman Maybe I did not explain well. The model output of the previous algorithm is an SQL-query like 'insert into table (field1, field2) values ('valueA',' valueB'), ('valueC','valueD')'. This result should be ported to the 'PostgreSQL execute SQL' algorithm with
or it can be performed by 'Pre-calculated Value'. But both options does not work.
As you can see in the picture above: it returns an empty string into the parameters. It says {DATABASE: postgis_25_sample, SQL: ' ' }
This is the workflow:
As you can see in the picture above: it returns an empty string into the parameters. It says {DATABASE: postgis_25_sample, SQL: ' ' }
@brusspi try casting that to string (should be "to_string").
I tried to cast to_string(). But nothing happens. It seems like the variable coming out of 'generate SQL-query' could not be read.
coming out of 'generate SQL-query'
@brusspi is this a core tool?
it is the 'Execute SQL'-algorithm
It produces a layer with 1 attribute, containing the query.
You can't use layer value as input for string parameter.
@alexbruy : So it is not a bug?
@gioman: If it is not a bug, can my question be changed to 'feature request'?
I think these issues are related to my question:
https://github.com/qgis/QGIS/issues/37347 and https://github.com/qgis/QGIS/issues/30397
@gioman: who do we have to contact to ask for more information to develop this featurerequest?
@tragewegen if you are looking for commercial support here is a list of companies: https://www.qgis.org/en/site/forusers/commercial_support.html
When using the algorithm 'PostgreSQL execute SQL', it is not possible to select an algorithm output as input in the SQL query. Also the 'pre-calculated value' gives an empty SQL-query in the log:
more info: https://gis.stackexchange.com/questions/352724/sql-insert-into-tablevalues-using-qgis-modeller
I'm using QGIS 3.16 on windows