TZSqlProcessor + FB 2.0 Embedded: SET TERM causes an error

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
seekbirdy
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 23.07.2007, 12:55
Location: Fryazino, Moscow region, Russia

TZSqlProcessor + FB 2.0 Embedded: SET TERM causes an error

Post 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.
Darkbow
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: 01.09.2009, 12:28

Post 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
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

It looks like zsqlprocess.delimitertype is set to dtDefault.
Set it to dtsetterm
seekbirdy
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 23.07.2007, 12:55
Location: Fryazino, Moscow region, Russia

Post 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?
Post Reply