Subject RE: [IBO] Changing the Transaction on a prepared SQL statement
Author IBO Support List
Ed,

Yes, this is acceptable.

Jason

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Ed Dressel
Sent: 28 December 2011 09:48 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Changing the Transaction on a prepared SQL statement

I need to change the transaction on a prepared SQL statement in a DSQL (but
it could be in a cursor as well). Is that allowed?

I tested it in an example, and it worked fine:

<sample>
procedure TForm1.GetOrderInfo(aTx: TIB_Transaction; const aOrderNo: integer;
out aCustomerNo: integer; out aSaleDate: TDateTime);
begin
dsqlGetClientID.IB_Transaction := aTx; // aTx is different each time
if not dsqlGetClientID.Prepared then
dsqlGetClientID.Prepare;
dsqlGetClientID.Params[0].AsInteger := aOrderNo;
dsqlGetClientID.ExecSQL;
aCustomerNo := dsqlGetClientID.FieldByName('CustNo').Asinteger;
aSaleDate := dsqlGetClientID.FieldByName('SaleDate').AsDateTime;
end;
</sample>

but I was curious if this is okay in a production environment?

Thank you,

Ed Dressel