问题
I have a table POI for Points of Interest with 3 triggers.
- One get geografic information. State, City, Street based on X,Y.
- Second do some validation on the field content and raise error if any violation.
- Third create audit record about what change and who make the change.
This table used to be handle using mapinfo so before been inserted they have a unique generated id created for mapinfo.
Now we are moving to QGIS and this program doesnt have an unique id. By my understanding oracle before v12 doesnt have autoincrement field so need to use a sequence to get unique id.
Now my problem is how can I create one unique value for the POI when have three different triggers?
Should I refactor all 3 triggers in separated functions and call them from a single trigger where I get the sequence.nextval? Or there is another way to update current function to use the same id ?
I really dont want touch those triggers because are part of a legacy app. But I dont see any other workaround.
来源:https://stackoverflow.com/questions/50765571/having-three-different-triggers-for-the-same-table-when-need-an-unique-id-for-in