Page 1 of 1

TZSqlProcessor + FB 2.0 Embedded: SET TERM causes an error

Posted: 18.09.2009, 10:59
by seekbirdy
Hi all,

I have Delphi 2007, Zeos 6.6.5-stable and Firebird 2.0.3 Embedded.
I try to execute a script with TZSqlProcessor, this script creates a procedure in my DB:

Code: Select all

SET TERM ^ ;

CREATE OR ALTER PROCEDURE G5M_WORKPLACE_DEACTIVATE (
    p_device_id integer,
    p_workplace_num integer)
as
begin
  /* Procedure Text */
  update g5m_probe
  set is_active=0
  where device_id=:p_device_id
    and workplace_number=:p_workplace_num
    and is_active=1;
end;

SET TERM ; ^


GRANT SELECT,UPDATE ON G5M_PROBE TO PROCEDURE G5M_WORKPLACE_DEACTIVATE;
And I get the following error:
SQL Error: Dynamic SQL Error SQL error code = -104 Token unknown - line 1, column 5 TERM. Error Code: -104. Invalid token The SQL: SET TERM ^
;
What could I do with this? Thanks in advance.

Posted: 19.09.2009, 19:34
by Darkbow
SET TERM has no meaning outside of the isql utility that comes with Firebird, hence the exception.

You will probably have to use ; directly (untested).

Good luck

Posted: 21.09.2009, 06:53
by seawolf
It looks like zsqlprocess.delimitertype is set to dtDefault.
Set it to dtsetterm

Posted: 21.09.2009, 07:56
by seekbirdy
Thanks a lot! Setting DelimiterType to dtSetTerm made the thing work. But another point is that there must not be any comments before SET TERM in the script. Is this a bug or maybe a feature?