CREATE PROCEDURE fails in TIBCScript

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

CREATE PROCEDURE fails in TIBCScript

Post by upscene » Wed 09 Feb 2011 08:39

Hi,

I just got a report saying that CREATE PROCEDURE fails in a script if SET TERM is not used. As you know, InterBase 2009 and up don't use this anymore, so TIBCScript should be able to leave this out as well.

Here's the code that fails:
CREATE PROCEDURE COUNTRY_GET_LIST_ALL
( IP_ISACTIVE Char(1) )
RETURNS
( OP_CODE VarChar(3),
OP_NAME VarChar(40),
OP_ISACTIVE Char(1)
)
AS
DECLARE VARIABLE EXCLUDE_ACTIVE CHAR(1);
BEGIN
EXCLUDE_ACTIVE = ' ';
IF (:IP_ISACTIVE = 'Y') THEN EXCLUDE_ACTIVE = 'N';
IF (:IP_ISACTIVE = 'N') THEN EXCLUDE_ACTIVE = 'Y';
FOR SELECT CODE, NAME, ISACTIVE
FROM COUNTRY
WHERE ISACTIVE :EXCLUDE_ACTIVE
INTO :OP_CODE, :OP_NAME, :OP_ISACTIVE
DO
SUSPEND;
END;
The part sent to the server is:
> CREATE PROCEDURE COUNTRY_GET_LIST_ALL
> ( IP_ISACTIVE Char(1) )
> RETURNS
> ( OP_CODE VarChar(3),
> OP_NAME VarChar(40),
> OP_ISACTIVE Char(1)
> )
> AS
> DECLARE VARIABLE EXCLUDE_ACTIVE CHAR(1)

< ERROR:

Dynamic SQL Error
SQL error code = -104
Unexpected end of command
Can you check on this?

AndreyZ

Post by AndreyZ » Wed 09 Feb 2011 15:26

Hello,

The point is that the TIBCScript component uses the ";" string by default as a delimiter string that separates script statements. To solve the problem you should set the TIBCScript.Delimiter property to another string, for example, "/".

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

Post by upscene » Wed 09 Feb 2011 18:36

AndreyZ wrote:Hello,

The point is that the TIBCScript component uses the ";" string by default as a delimiter string that separates script statements. To solve the problem you should set the TIBCScript.Delimiter property to another string, for example, "/".
This would mean that TIBCScript does NOT work the same as InterBase 7 ISQL.

My users expect this to work.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 11 Feb 2011 14:06

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next IBDAC build.

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

Post by upscene » Wed 16 Feb 2011 17:54

Dimon wrote:Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next IBDAC build.
I think you can EXECUTE BLOCK to it as well, this statement has the default terminator in it too.

And obviously the TRIGGER statements too.

AndreyZ

Post by AndreyZ » Thu 17 Feb 2011 12:55

Thank you for the information. We have fixed this problem for all cases mentioned above.

Post Reply