Page 1 of 1

SET TERM doesn't work as expected?

Posted: Thu 28 Jan 2010 08:34
by upscene
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.

Posted: Thu 28 Jan 2010 12:09
by Plash
You should use TIBCScript if you execute a script with several commands.

Posted: Thu 28 Jan 2010 12:14
by upscene
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. ;)

Posted: Thu 28 Jan 2010 14:03
by Plash
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.

Posted: Mon 01 Feb 2010 09:17
by upscene
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.

Posted: Tue 09 Feb 2010 13:27
by Plash
We have fixed this problem. The fix will be included in the next build of IBDAC.