Subject Changing the Transaction on a prepared SQL statement
Author Ed Dressel
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