I am using a Python script in QGIS. This script does the job with another database, but in my database (the same MCD), the script sends this error
psycopg2.errors.NullValueNotAllowed: FOREACH expression must not be null
CONTEXT: PL/pgSQL function insert_vue_cable_optique() line 67 at FOREACH over array
I checked the function and the line where i have the bug:
FOREACH _id_projet IN ARRAY (SELECT projets_actifs FROM "compl".connexion WHERE identifier = NEW.modification_identifier)
LOOP
INSERT INTO "compl".projet_noeud_infra(id_projet, id_noeud_infra) VALUES (_id_projet, _id_noeud_infra);
END LOOP;
RETURN NULL;
In the table compl.connexion, there is data, but the problem is with the insert into compl.projet_noeud_infra
Could you please help me ?
I tried to manually insert data into the table compl.projet_noeud_infra, but it doesn’t work
Takieddinex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.