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 example “3543907”, the trigger searches the MUNICIPIOS feature for the same CD_GEOCMU key column and fills in in the SETORES feature, the UF, MUNIC and SIGLA_RISC fields (automatically added). Is it possible to do this through Trigger? Considering that the fields are of the same type.
- SETORES.CD_GEOCMU = MUNICIPIOS .CD_GEOCMU
- SETORES.SIGLA_RISC = MUNICIPIOS .SIGLA_RISC
- SETORES.UF = MUNICIPIOS .UF
- SETORES.MUNIC = MUNICIPIOS .NM_MUNICIP
I'm using the geopackage database and DB Browser for SQLite to try to create this trigger.