Questions tagged [trigger]

in this context implies a SQL trigger, (aka database trigger), which is a type of stored procedure that is called automatically in response to a specified event in the database.

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 views

Field value populated ether by another field value or by user input based on a Boolean field in QGIS form

I'm creating a winter bird survey form in QGIS for use in Qfield. There is a field called "mixed" which records whether a flock is mixed(1) or not(0). Another field called "sp_count&...
2 votes
1 answer
56 views

Backup table does not replicate geometry, fed by trigger in pgAdmin (postGIS)

I have two tables, A and B. B is a backup of A. Table A has a trigger: CREATE OR REPLACE TRIGGER trigger AFTER INSERT OR UPDATE OR DELETE ON A FOR EACH ROW EXECUTE FUNCTION ...
0 votes
0 answers
36 views

QGIS - Unable to save after mergin attribute - (SpatiaLite - Triggers)

I'm working with SpatiaLite layers, and I'm currently encountering a problem when I use the tool: « Merge attributes of selected entities ». I use several triggers that are not the cause of the ...
3 votes
1 answer
233 views

Using ST_Intersects inside of an ST_Within

I have a PostgreSQL trigger function getting executed by QGIS. That is working fine. I am trying to modify my function to count the number of points that fall within the intersection (clipped) ...
2 votes
2 answers
88 views

QGIS - Trigger's execution too slow (QGIS freeze)

I am currently working on a SpatiaLite layer that is updated after insertions and modifications through triggers. When I copy-paste features on the "HABITATS_POLY" layer, it triggers updates ...
0 votes
1 answer
47 views

QGIS - SpatiaLite triggers doesn't update properly each field

See edit at the end of the post I am working in two layers: HABITATS_POLY (important fields: "EUNIS_1" , "EUNIS_2" , "EUNIS_3" , "EUNIS_4" ; "EUNIS22_1&...
1 vote
1 answer
43 views

QGIS - How to update several rows with triggers SQLite

I currently have two SpatiaLite layers: HABITATS_POLY: Key fields include EUNIS_1, EUNIS_2, EUNIS_3, EUNIS_4, EUNIS22_1, EUNIS22_2, EUNIS22_3, EUNIS22_4. GESTION_CODES: Key fields include EUNIS and ...
1 vote
1 answer
46 views

QGIS - SpatialLite - Trigger for code correspondences - Manage multiple results

I have a database containing correspondences between codes (e.g., A = 1 = 11 = H = M, etc.). I've made the first 100 rows of this data available for download. BDD Extract I would like a feature where, ...
0 votes
0 answers
56 views

Triggers for multiple tables in Geopackage and DB Browser for SQLite for QGIS use

I need to build an automatic trigger in the database so that when inserting/updating a new polygon in the SETORES feature and filling in the CD_GEOCMU key attribute with the appropriate code, for ...
0 votes
0 answers
63 views

QGIS how to improve triggers on SQL - SpatiaLite

I'm looking for a way to improve the way my triggers are working on a SpatiaLite layer. Currently, it takes 45 seconds to work on 1000 entities. Is there a way to improve the performance? My triggers ...
1 vote
0 answers
39 views

Refresh attribute table after SQL trigger

I'm utilizing a trigger on a SpatialLite layer in QGIS. This trigger is designed to update a field when its content matches with another in the database. Here's the trigger's code: CREATE TRIGGER ...
1 vote
2 answers
63 views

Geopackage trigger doesn't work

I use this trigger on a geopackage table: CREATE TRIGGER upd_iae_surf AFTER UPDATE ON "IAE CRD Surf" BEGIN UPDATE "IAE CRD Surf" SET "taille" = ROUND(ST_Area(NEW.geom)/...
3 votes
1 answer
125 views

Date management problem in a trigger with PostgreSQL [closed]

I created two tables on PostgreSQL. I would like to note in a layer a date and retrieve: the corresponding year in a variable, then reuse the year variable in various other attributes integrating ...
1 vote
2 answers
292 views

Handing over polygon attribute to new point while digitizing

My task is to work with bird observation data in an area, that is divided into zones as different polygons (A1, A2, etc.). I have the hand-written lists of observations and want to bring all entries ...
2 votes
1 answer
337 views

FME Server Automation: Watch URL/Published data in the internet

I'd like to build an automation in FME Server consisting of one trigger (watch URL/xlsx-sheet) and an email-action. The problem is about the trigger: There is a federal environment agency that ...
1 vote
0 answers
44 views

Bounding box not working well in trigger PostgreSQL - PostGIS

My trigger function consists of collecting the vertices of a polyline table "depart_bt", searching for the point entities of the table “support_bt” which coincide with the vertices of the ...
1 vote
0 answers
20 views

How can I round numeric area values in PostGIS? [duplicate]

I am using a trigger function in PostGIS to calculate the area in hectare of each polygon that is created or changed. The field is called "flaeche_ha_gis", the datatype is "double"....
2 votes
2 answers
396 views

TRIGGER FUNCTION: With UPDATE of geom: Calculate automatically area column

I'm using PostGIS and I would like to use trigger to: when there is a change in the geometry of a polygon, that its surface is also updated. I have tested several syntaxes but I always get an error &...
4 votes
1 answer
2k views

ArcSDE 10.1 Insert/Update Trigger on Adds (A) Table (Oracle 11g) and Feature Services on ArcGIS Server

I'm trying to use a trigger to update a versioned dataset in an SDE environment. Basically, I wanted to implement a system of unique ids called GISID. Initially, when a feature is created (inserted), ...
1 vote
1 answer
241 views

Wrong schema while importing data via with ogr2ogr into postgresql database and using dblink

I have the following issue: I have a table on a PostgreSQL database which triggers its changes via dblink to another table in a different data base. The trigger function looks as follows: CREATE OR ...
1 vote
1 answer
2k views

Use a sde.st_geometry function in a PL/SQL trigger

I have a PL/SQL trigger: 1 create or replace trigger "projects_to_meas_trig" before update of asset_id 2 on projects 3 4 for each row 5 declare 6 v_length number; 7 begin 8 ...
2 votes
1 answer
471 views

Trigger to update foreign table

I have two similar tables (sections) in two different databases (QGIS cloud database and AWS PostgreSQL database). I update the QGIS Cloud database (so that everyone in my organization can see the ...
6 votes
0 answers
776 views

Using geopackage trigger in QField [closed]

I tried to create trigger in GeoPackage so one layer would get updated by data from the other, both in the same GeoPackage. It worked perfectly within desktop QGIS but I get this error message in ...
4 votes
1 answer
208 views

Trigger in PostGIS that deletes or updates a feature based on location

In PostGIS I have two tables: closures (id, name, endpoint, geom) and chambers (id, name, geom). A closure must always be placed in a chamber for which it will take the chambers name it has been ...
2 votes
1 answer
403 views

PostGIS trigger : table and materialized view

I have a PostGIS polygons table for my "cities". I have a point table for my "boreholl". I created a "mv" materialized view defined by a spatial join as follows: SELECT ...
0 votes
2 answers
521 views

Having changes to SpatiaLite table column to automatically update GIS layer

If the length of a line is changed (direct SQL), I would like the layer to reflect the new line length and also update the label for the feature. How can that be accomplished? It appears that ...
4 votes
2 answers
288 views

How to trigger calculation on QGIS startup?

I am preparing a field worker / QField project an would like to visualize green spaces based on the days that have elapsed since the last field worker has visited that site. I am testing with a very ...
1 vote
0 answers
39 views

Updating the other column when data in the column changes in ArcGIS [closed]

In ArcGIS in one of my layers, I combined two columns with calculated field and printed it into a third column. However when I change a data in my first column, I want that data in the third column to ...
0 votes
1 answer
87 views

Under what circumstances would the _DELETE trigger get called? (_EVW)

Oracle 18c/10.7.1 geodatabase: When an FC is registered as versioned (with option to move edits to base), several triggers get automatically created: V000001_DELETE V000001_INSERT V000001_UPDATE ...
2 votes
2 answers
140 views

Prevent deletes in a versioned table at the database level

I have a table in an Oracle 18c/10.7.1 geodatabase. The table is versioned with the option to move edits to base. As far as I can tell, it's not possible to prevent ArcGIS Desktop users from deleting ...
0 votes
0 answers
164 views

Condition with using geometry OLD and NEW

Is there a posibility to use a condition with OLD and NEW parameters? Using postgres 12, and pgAdmin Geometry in Qgis Trigger CREATE TRIGGER abc_trigger AFTER INSERT OR UPDATE OR DELETE ON "...
3 votes
1 answer
748 views

Trigger PostGIS QGIS

I have 2 layers on PostGIS: a point layer named 'tdia' and a polygon layer named 'com': -the com layer contains the city name. (Polygon) -the tdia layer contains bus stops. (point) I want to create a ...
1 vote
0 answers
97 views

ST contains not working properly with trigger

I have table1, on which people do regular inserts, and table2, that needs to get updated based on what was inserted to table1. table1 has id integer type text ref text geom polygon ...
2 votes
1 answer
956 views

Insert/Update/Delete table from another table changes in PostGIS

I'm trying to build a function that Insert/Update/Delete rows of a table based from another table changes. Unfortunately I could not continue, some problems occured: DELETE isn't work correctly: Any ...
1 vote
1 answer
144 views

Make array_append in trigger with PostGIS intersection

I've 2 layers : linestring with column id_line and polygone, drawn by user. I trying to get id_line on linestring who intersects polygon. I've got it in qgis with : aggregate( layer:= 'aep_cana', ...
2 votes
3 answers
1k views

PostgeSQL Trigger St_Intersect Insert, Update

I have a problem creating a trigger in PostgreSQL that will get data from polygon layer. Issue: I have two tables: 1. point (id, geom, address) 2. polygon (id, geom, address) Polygon table ...
2 votes
1 answer
641 views

Perform intersection using a TRIGGER

I've two geometry table inside my DB: buffer: id INTEGER SERIAL PRIMARY KEY, geom POLYGON polygons: geom MULTIPOLYGON I need have the intersection between buffer and polygons and I will do this ...
1 vote
0 answers
213 views

RAISE NOTICE from trigger to QGIS

I work on vue postgresql made with table, so for save I have to use trigger. My trigger do a lot of thing and I have to send message to the user to make him understand what happend. But QGIS ...
1 vote
1 answer
224 views

Dynamic triggers with table_name in PostGIS

I want make a dynamic trigger with PostgreSQL/PostGIS like this. I try that triggers make more generic for use with many tables with the same pattern. When i use direct table's name in code, that's ...
3 votes
3 answers
1k views

Running second FME workspace when first workspace is completed

I've got a workspace that inserts data in a database. It runs on FME Desktop and FME Server. After the insertion (the first workspace) is completely done, I'd like to run a second workspace that ...
2 votes
1 answer
629 views

Automatically add points geometry while GPS logging?

I have a PostgreSQL 10 Server (x64) running on my Windows 8 (x64 based) machine. On the top of my Postgres database, there is PostgREST API running that receives GPS data (5 seconds interval) from a ...
1 vote
0 answers
80 views

Attribute objects in Enterprise geodatabase automatically

There is a Enterprise geodatabase (MS SQL Server, ArcGIS), it has about 100 feature classes. It is necessary to automate the process of populating a unique number to each object in the database. ...
1 vote
0 answers
154 views

PostgreSQL Trigger to keep track of table changes [closed]

I am trying to create a trigger (PostgreSQL 9.4) to track changes made to a table. This is my approach: CREATE OR REPLACE FUNCTION taxon_history() RETURNS trigger AS $BODY$ BEGIN IF TG_OP = '...
2 votes
0 answers
99 views

Trigger PostgreSQL

I have a pb to make a trigger. I have 3 tables and a georeferenced layer: The common table contains: PKcom, INSEE The cadastre table contains: PKcadastre, Fkbat, section, parcel The building table ...
2 votes
0 answers
117 views

Per row commit when editing PostGIS data with QGIS, with PostGIS triggers checking inserted data

I have a PostGIS trigger assuring that records with a Point-geometry inserted in a table fall within Polygons in another table. Simple example: -- Trigger function CREATE OR REPLACE FUNCTION ...
1 vote
1 answer
125 views

Update geometries with ST_UnaryUnion at TRIGGER

We are currently working on database with multipolygons and we're using QGIS 3. Sometimes it's very useful to work with parts (each page of document is separate part of multipolygon), however at the ...
3 votes
0 answers
89 views

Trigger - Calculate area of a layer inside feature by changing the inner layer

Working with PostGIS database and QGIS, I have two polygons layers, an external with land lots (lotes) and an internal with building area (areaconstruida). In the "lotes" layer, I need a field in ...
2 votes
1 answer
127 views

Trigger - Calculate area of a layer inside feature

I'm trying to create a trigger to auto-fill a field of a table in postGIS based on two polygon layers geometry. I'm using QGIS for geometry updates. The first layer (lotes) has bigger polygons and ...
2 votes
1 answer
2k views

Geometry based automatic fill of fields in attribute table

I'm looking for solutions for auto-fill attribute table fields of spatial layer on QGIS from updates in geometry. All layers were created as polygon shapefiles. Attribute table fields are dependent ...
1 vote
0 answers
589 views

How to Create 'Update Triggers' to Track Field Values Changes When Data is Versioned?

How can I create a trigger to capture when a field is changed from one value to another if my data is versioned? I am not able to run an UPDATE trigger and grab ':new' and ':old' values because with ...