zac
zac

Reputation: 4918

Firebird - Way to determine delete occurred from constrained or not inside trigger

Is there a way to determine delete occurred from using constrained with cascade delete or not inside trigger ?

Upvotes: 2

Views: 84

Answers (1)

ain
ain

Reputation: 22759

No - when a row is deleted then appropriate triggers will fire but there is no "context" what caused the delete. However, in the AFTER DELETE trigger you can check does the master record exist - if it doesn't then there is a good chance that the delete is triggered by the ON DELETE CASCADE constaraint and not because user issued "direct" DELETE on the row.

Upvotes: 2

Related Questions