-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Rule: never use multiple UPDATE OF in trigger event clause #27
Comments
from SonarSource: The DML events clause of a trigger is not meant to be used with multiple OF conditions. When it is, only the last one will actually be taken into account, without any error message being produced. This can lead to counter-intuitive code. Only the UPDATE event should have an OF condition, and there should be at most one occurence of it. Noncompliant Code Example
Compliant Solution
|
I ran the following test in a 19c Database instance:
the result (console output) was:
Hence, this rule makes really sense. |
…n trigger event clause.
Language Usage / Stored Objects / Triggers
Never use multiple UPDATE OF statements in the event clause of a trigger
bad:
CREATE OR REPLACE TRIGGER xyz BEFORE UPDATE OF column1 OR UPDATE OF column2 ...
good:
CREATE OR REPLACE TRIGGER xyz BEFORE UPDATE OF column1, column2 ...
The text was updated successfully, but these errors were encountered: