Last active
May 23, 2024 08:18
-
-
Save martinusso/5a98b609c2941a91e703 to your computer and use it in GitHub Desktop.
check if trigger exists (verificar se trigger existe) - Firebird
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
RDB$TRIGGER_NAME FROM RDB$TRIGGERS | |
WHERE | |
RDB$TRIGGER_NAME = 'triggerName' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute block | |
as | |
declare variable stmt VARCHAR(100) = 'DROP TRIGGER TRIGGER_NAME;'; | |
begin | |
if (exists (SELECT RDB$TRIGGER_NAME FROM RDB$TRIGGERS WHERE RDB$TRIGGER_NAME = 'TRIGGER_NAME')) then | |
begin | |
execute statement stmt; | |
end | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment