Subject RE: [IBO] TIB_Script Events
Author Helen Borrie
> > In the TIB_Script component are the events fired for each sql item
> > withing the script? Or, do they relate to the entire script in general?
> >
> > Bill

At 10:58 AM 30/03/2006, you wrote:

>events fire when their transaction commits. If you place commits int he
>script, that's when the events will fire. If you commit only at the end of
>the script, then taht's when the events will fire

Ooops. I doubt that Bill's question was about database events, but
about the Delphi events that are published by TIB_Script.

If it was the Delphi events then, in general, those events apply to
the whole process. However, because statement-level exceptions will
intervene in the process, you can write an error handler that can
catch these exceptions and log them (or whatever you want to happen
before execution proceeds).

The OnStatement event lets you intervene in the process at statement
by statement level, just before a statement is submitted, so you can
intervene to some extent as each statement except the first one
executes and react to any exception that occurred in the previous
statement. Consult the help for information about the various
properties of TIB_Script that you can read and methods you can call
to affect the continued execution of the script.

You could have a look at the sourcecode for the scripting utility in
IB_SQL.exe, to see how Jason handles exceptions there.