[Qgis-user] Loading filtered database table as temp layer

Michael Gieding michael.gieding at live.de
Tue May 4 04:00:58 PDT 2021


Hello everybody,

@Karl: "execute SQL" seems not to be an option, as I found no way to pass the output to load it as a new layer.

@Bjoern: your hint looks promising. In the end there are two layers. One is the output of "PostgreSQL execute
and load". Seems it's "bypassing" the rest of the model.  The second is the temporary layer which is generated
through "drop fields" --> "load layer into project". Maybe I find a way to supress the first layer so only the
temporary one is left. In a first step it does (nearly) what I want.


Many thanks to you both,

Michael

________________________________________
Von: pathmapper <pathmapper at posteo.de>
Gesendet: Dienstag, 4. Mai 2021 12:16
An: Michael Gieding
Cc: QGIS-User Mailinglist
Betreff: Re: [Qgis-user] Loading filtered database table as temp layer

Hi Michael,

if it's just about creating a temporay layer as model output, you could
try to use the "Drop field(s)" algorithm after "PostgreSQL SQL execute
and load" in your model.

Just choose for the field "Input layer" the algorithm output of the
"PostgreSQL SQL execute and load" algorithm, leave the "Fields to drop"
field empty and enter a custom name for "Remaining fields".

You should also set a algorithm dependecy there (so the "Drop field(s)"
algorithm is executed after "PostgreSQL SQL execute and load").

This way the "Drop field(s)" algorithm doesn't remove any fields but you
get the option to create a tempory layer.

Hope this helps.

Bjoern




More information about the Qgis-user mailing list