Page 1 of 1

CREATE PROCEDURE fails in TIBCScript

Posted: Wed 09 Feb 2011 08:39
by upscene
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?

Posted: Wed 09 Feb 2011 15:26
by AndreyZ
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, "/".

Posted: Wed 09 Feb 2011 18:36
by upscene
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.

Posted: Fri 11 Feb 2011 14:06
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next IBDAC build.

Posted: Wed 16 Feb 2011 17:54
by upscene
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.

Posted: Thu 17 Feb 2011 12:55
by AndreyZ
Thank you for the information. We have fixed this problem for all cases mentioned above.