Subject Re: [IBO] IB_SQL: Problems executing script
Author Helen Borrie (TeamIBO)
At 07:58 PM 16-04-02 +0000, you wrote:
>I'm trying to use IB_SQL to execute a script that I wrote. I
>origionally wrote it to run with "Interbase Windows ISQL" that came
>with IB 5.6. I'm now using FB 1.0 and IB_SQL.
>
>A couple problems:
>
>1) My connect command doesn't work:
>
>CONNECT "c:\mypath\mydb.gdb" USER 'sysdba' PASSWORD 'masterkey';
>
>This used to work under ISQL and IB 5.6. Using IB_SQL and FB 1.0, it
>tells me that the syntax is incorrect. Does anyone know why?

Use single quotes on the path string. IB 6 and Firebird are now
extra-fussy about not confusing single and double-quotes. The unbreakable
rule is now "single-quotes for strings, double-quotes for delimited
identifiers".


>2) To get past #1 for now, I removed the connect command. I connect
>manually via the IB_SQL Connection tab, and click the "Execute
>Script"
>icon. I load the script (without the connect command) and hit
>"Execute". The "IBO" hourglass cursor comes up for a while. Then,
>it
>goes away. I assume that that means that the script is done. I
>click
>on the check mark icon, and it gets grayed out. I try to close the
>window, but I get an error messag that says, "Script is currently
>executing".
>
>Does anyone know what's wrong? Is the script done or not? If not,
>how do I tell when it's done? Why did the "IBO" hourglass cursor
>disappear if it's still running? If it's done, why can't I close the
>window? I've been waiting a long time.

Possibly just some hiatus in the sequence...the script tool invokes isql,
which itself starts a total of three transactions to run a script.

When you say "I clicked the checkmark" I assume you are talking about the
"Commit" button...a red check shape on a yellow background. When you said
it got grayed out, it sounds as if it was the Commit button.

This sequence of events isn't "the normal" when running scripts but it
doesn't necessarily mean the script didn't run. In these conditions as you
describe, usually the cure-all is to go to the Transaction tab and simply
roll back any transaction that is currently active (the Commit button will
be live in that condition).

Without seeing the actual script I can't tell what kind of transaction
resolution was happening inside the script. Still, it's worth
understanding that, if you have a SET AUTO[DDL] ON inside the script, it
will autocommit only DDL statements. Unless you also have a COMMIT;
statement at the very end, any DML in the script will be unresolved.

Don't try to run the script again without actually checking whether
everything worked on the bumpy trip. The most likely thing is that the DDL
is committed and the DML hasn't.

It won't hurt to study the ISQL docs a bit to get a handle on what goes on
when a script is processed.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com