On 04/02/2026 22:06, Lester Caine wrote:
> I'm testing things in Flamerobin, and `set term #;` was my first though,
> it still gives the same problem.
>
> ----
> set term #;
> execute block as
> begin
> if (exists(select rdb$relation_name
> from rdb$relations
> where rdb$relation_name = 'wt_site_access_rule'))
> then
> execute statement 'drop table wt_site_access_rule'#
> end
> set term ;#
> ----
> Unexpected end of command - line 8, column 27
Yes, that is because *inside* the PSQL of the execute block, you need to
continue using `;`, only *after* the block should you use the
alternative terminator `#`:
```
set term #;
execute block as
begin
if (exists(select rdb$relation_name
from rdb$relations
where rdb$relation_name = 'wt_site_access_rule'))
then
execute statement 'drop table wt_site_access_rule';
end
set term ;#
```
> But where I'm actually using it is in the PDO driver wrapped by laravel
> and I've just tried adding the set term wrapper there with the same
> failure :(
SET TERM is *not* a Firebird statement, it's an ISQL command to control
at what character it decides a statement is complete to send to the
server. Some other Firebird tools follow its example, and support it as
well, but it is not universal, and not server-side.
The driver (or its wrapper) is parsing it as a script (splitting on `;`)
and then executing the elements it split, while this should be executed
as a single statement.
Mark
--
Mark Rotteveel