Consider the following script:
set term ^;
exit
^
execute block
as
begin
execute statement 'this will fail';
end
^
The exit
is perfectly valid and does cause script execution to end. At least in IBExpert where I am testing this. But I want to do this programmatically.
set term ^;
execute block
as
begin
if (exists(select 1 from sometable where somevalue = 1)) then begin
-- This only exits the block, not the script
exit;
end
end
^
execute block
as
begin
execute statement 'this will fail';
end
^
Is the exit
in my first example valid Firebird or is IBExpert handling this itself? Is there a different way to exit the entire script conditionally?