having three different triggers for the same table when need an unique id for insert

旧巷老猫 提交于 2019-12-08 11:52:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!