Subject | Re: [IBO] executing a script |
---|---|
Author | TeamIBO |
Post date | 2002-01-20T23:02:04Z |
> 1. which is the way to programmatically clear, prepare and execute aYes, although prepare does not apply in this situation. Here is a
> TIB_Script ?
simplified snippet from my DBak application (which actually creates
its own TIB_Script instance to work with, but you can use an existing
one if you prefer)...
with TIB_Script.Create(Self) do
try
IB_Connection := MyConnection;
IB_Transaction := MyTransaction;
OnError := DoScriptError;
OnStatement := DoScriptProgress;
SQL.AddStrings( StringList_Of_Statements );
Execute;
finally
Free;
end;
DoScriptError and DoScriptProgress are my event handler code.
> 2. how do I understand if there were errors ?See the OnError event.
> 3. is it possible to insert several SQL commands in a TIB_Script andJust assign the entire script of a series of commands that you want
> have them executed one after another ?
executed to the SQL property (as shown above).
Several of the sample applications use TIB_Script to create the
database if it does not exist, so take a look at the samples for more
information.
hth
--
Geoff Worboys - TeamIBO
Telesis Computing