Subject Re: [IBO] TIB_Script and stored procedures
Author Helen Borrie
At 02:38 PM 7/03/2005 +0100, you wrote:

> TIB_Script seems to be "incompatible" with stored procedures
>called by an "execute procedure" statement.
>It gives the error
>Dynamic SQL Error
>SQL error code = -104
>Token unknown - line 2, char 1
>which seems to be a database error.

It is an engine error. It occurs whenever the engine receives a word in an
SQL statement that doesn't belong there. So, whatever is happening "under
the hood" in IBOConsole, it is occurring because the word "execute" occurs
somewhere it shouldn't. My guess is that the program has failed to
initialise a buffer properly.

>The same code works for a TIB_DSQL or in isql without
>any problems, though.

Nope, EXECUTE PROCEDURE works fine in a TIB_Script. But a script is not
interactive SQL.

>You can test this with, for example, IBOConsole, which
>seems to use the TIB_Script component in the
>"Interactive SQL" dialog.

A program would not use a script for interactive SQL. I confirm that the
bug you describe is present in IBOConsole - the best place to submit this
bug description would be the firebird-tools list, making sure you report
the build number (from the Help/About box). I believe Lorenzo Mengoni (the
author of IBOConsole) monitors that list.

But you can do a reality check on your theory about TIB_Script by using the
Script tool in IB_SQL. Connect to the Employee database, open a Script
window, and enter the line

execute procedure add_emp_proj (2, 'MAPDB') ;
<Press Enter to insert a CRLF - this is essential at the end of a script>

Hit the Execute button and you will see that the script runs fine.

>When you try to execute the statement
>"execute procedure some_proc"
>it gives the error mentioned above.


>Does the TIB_Script component parse and modify
>the "execute procedure" statement in some way, and
>maybe break it somehow?

You are not looking at a TIB_Script here. It seems to be a custom
component derived from TIBOQuery.

>Btw., the procedure is executed anyways. It just gives
>this error message/exception.

IBOConsole isn't perfect, but Lorenzo did do some bug-fixing on it recently
(February 15 2005). Do you have that version? (I don't, I have build, which seems to be from July