Subject Re: [IBO] [Jason] Fail to prepare sentence in all my queries after update to IBO 4.9.14
Author hamacker
I know why.

I need to put a TIB_Transaction(FB_SERVER_TRANS) in my form and associate
with this script and fb_server connection:

MyScript.IB_Transaction:=FormMAIN.FB_SERVER.DefaultTransaction;

and after execute include :

FB_SERVER_TRANS.CommitRetaining;

as :
MyScript:=TIB_Script.Create(Self);
MyScript.IB_Connection:=FB_SERVER.IB_Connection;
MyScript.IB_Transaction:=FB_SERVER.DefaultTransaction; <---
MyScript.SQL.Clear;
MyScript.SQL.Add('CREATE USER DELMICE PASSWORD ''delmice'';');
MyScript.SQL.Add('CREATE USER EDERSON PASSWORD ''ederson'';');
MyScript.SQL.Add('CREATE USER EDNA PASSWORD ''edna'';');
MyScript.SQL.Add('CREATE USER ELAINE PASSWORD ''elaine'';');
MyScript.SQL.Add('CREATE USER ELIANA PASSWORD ''eliana'';');
MyScript.SQL.Add('CREATE USER ERIKA PASSWORD ''erika'';');
MyScript.SQL.Add('CREATE USER FABIO PASSWORD ''fabio'';');
MyScript.SQL.Add('CREATE USER FERREIRA PASSWORD ''ferreira'';');
try
MyScript.Execute;
FB_SERVER_TRANS.CommitRetaining; <---
except
on e:exception do
begin
ErrorLog('Erro ao criar/remover logins f�sicos
:',e.message,MyScript.SQL.Text);
end;
end;

Without this modification only fist line are executed.

In previous version of IBO these modifications are do not necessary becase a
default transaction will be created.

2011/9/1 hamacker <sirhamacker@...>

> Unfortunately, as same problem with or without ';'.
>
> But I discover a new bug :
>
> MyScript:=TIB_Script.Create(Self);
> MyScript.IB_Connection:=FB_SERVER.IB_Connection;
> MyScript.SQL.Clear;
> MyScript.SQL.Add('CREATE USER DELMICE PASSWORD ''delmice'';');
> MyScript.SQL.Add('CREATE USER EDERSON PASSWORD ''ederson'';');
> MyScript.SQL.Add('CREATE USER EDNA PASSWORD ''edna'';');
> MyScript.SQL.Add('CREATE USER ELAINE PASSWORD ''elaine'';');
> MyScript.SQL.Add('CREATE USER ELIANA PASSWORD ''eliana'';');
> MyScript.SQL.Add('CREATE USER ERIKA PASSWORD ''erika'';');
> MyScript.SQL.Add('CREATE USER FABIO PASSWORD ''fabio'';');
> MyScript.SQL.Add('CREATE USER FERREIRA PASSWORD ''ferreira'';');
> try
> MyScript.Execute;
> except
> on e:exception do
> begin
> ErrorLog('Erro ao criar/remover logins f�sicos
> :',e.message,MyScript.SQL.Text);
> end;
> end;
>
> No error, but only first user is created, ie. only first line are executed
> and all others ignored.
> I try copy/paste into IBExpert and run fine.
> I test with GRANT with many lines and all lines are executed, very
> strange, apparently when CREATE USER statment is used only first line will
> be executed.
> Why ?
>
>
> 2011/9/1 hamacker <sirhamacker@...>
>
>> I will try...let me se...
>>
>>
>> 2011/9/1 Woody <woody-tmw@...>
>>
>>> **
>>>
>>>
>>> From: "hamacker" <sirhamacker@...>
>>> Sent: Thursday, September 01, 2011 11:46 AM
>>> To: <IBObjects@yahoogroups.com>
>>> Subject: Re: [IBO] [Jason] Fail to prepare sentence in all my queries
>>> after
>>> update to IBO 4.9.14
>>>
>>>
>>> > Well, before I used IB_Query.ExecSQL for insert/update/detete
>>> > or IB_Query.Execute for execute procedure...
>>> > I use TIB_Script only when I have two or more sentences separate by
>>> ";".
>>> >
>>> > To new applications I can change that to a new method, but all current
>>> > applications is more fast use IB_Query.ExecuteDDL(m.sql.text) for
>>> > insert/update/delete.
>>> >
>>> > Just would like to know, if it�s a bug or not on this new version.
>>> >
>>> > As you say, this new version change old ways.
>>> >
>>>
>>> Have you tried removing the ending semi-colon from a single statement
>>> query
>>> to see if it's somehow interpreting more than it needs to?
>>>
>>> Woody (TMW)
>>>
>>>
>>>
>>
>>
>


[Non-text portions of this message have been removed]