在触发器中引发错误之前提交更新
我正在编写一个更新后触发器来记录特定列的用户名和更新时间。 我需要提交更新,然后向用户显示一条消息,建议他们做其他事情。 我无法使用 dbms_output.put_line,因为应用程序向用户隐藏了这些消息(不可能更改应用程序,因为它是第三方应用程序,并且许可问题阻止了任何更改)。我尝试使用 raise_application_error 显示消息,但因为它引发错误,所以阻止更新提交。
有谁知道解决这个问题的方法吗?
I am writing an after update trigger to log the username and time of updates to a specific column.
I need the update to commit and then a message displayed to the user to advise them to do something else.
I am unable to use dbms_output.put_line as the application hides these messages from the user (changing the aplication is impossible as its a third party application and licensing issues prevent any changes). I have tried using raise_application_error which displays the message but because it is raising an error it prevents the update from commiting.
Does anyone know of a way around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在不更改应用程序的情况下,无法向用户实时呈现消息。如果您拥有所有用户的电子邮件地址,我想触发器可以向他们发送一封电子邮件,告诉他们需要做什么?
There is no way to present a message to the user in real time without changing the application. If you hold all the users' email addresses I suppose the trigger could send them an email telling them what they need to do?
如果没有其他选择,有一个令人讨厌的解决方法。
在触发器中,您可以首先提交作业 (dbms_job.submit) 并在作业中进行更新。然后提出错误。
there is a nasty workaround, if there is no other alternative.
In the Trigger you can first submit a job (dbms_job.submit) and make an update within the job. And then raise an error.