Skip to content

Instantly share code, notes, and snippets.

@martinusso
Last active May 23, 2024 08:18
Show Gist options
  • Save martinusso/5a98b609c2941a91e703 to your computer and use it in GitHub Desktop.
Save martinusso/5a98b609c2941a91e703 to your computer and use it in GitHub Desktop.
check if trigger exists (verificar se trigger existe) - Firebird
SELECT
RDB$TRIGGER_NAME FROM RDB$TRIGGERS
WHERE
RDB$TRIGGER_NAME = 'triggerName'
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