SET TERM doesn't work as expected?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

SET TERM doesn't work as expected?

Post by upscene » Thu 28 Jan 2010 08:34

A test of mine is reporting the following:

when running the following script against a Firebird database:

Code: Select all

SET TERM ^^ ;
CREATE PROCEDURE S_GET_VERSION2 returns (
   MAJOR_VERSION SmallInt,
   MINOR_VERSION SmallInt,
   LAST_SCRIPT_NUMBER Integer,
   LAST_SCRIPT_FILE VarChar(255)) AS
BEGIN
   SUSPEND;
END ^^
I get the following error message:

Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 5
TERM



Please fix.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 28 Jan 2010 12:09

You should use TIBCScript if you execute a script with several commands.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Thu 28 Jan 2010 12:14

Plash wrote:You should use TIBCScript if you execute a script with several commands.
Of course, I understand that, which is exactly what I'm doing.

That is, I'm using TIBCScript in combination with a TIBCQuery via the .Dataset property of the script component.

It seems you're passing the SET TERM to the Dataset and to the server?

That would be an error on your part. ;)

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 28 Jan 2010 14:03

We could not reproduce the problem. Please send to support*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Mon 01 Feb 2010 09:17

Right, I figured it out --

I have a BeforeExecute event handler, SET TERM is passed to that with "Omit = True", in my handler, I was setting that to False if it's not something specific that I'm checking.

It seems that you check -before- doing the event.

Perhaps these two should be switched around as the current behaviour allows the programmer to override your behaviour on these specific occasions.


Hope this helps.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 09 Feb 2010 13:27

We have fixed this problem. The fix will be included in the next build of IBDAC.

Post Reply