procedure TForm1.TransferButtonClick(Sender: TObject);
var
Amt: Integer;
TD: TTransactionDesc;
begin
if not SQLConnection1.InTransaction then
begin
TD.TransactionID := 1;
TD.IsolationLevel := xilREADCOMMITTED;
SQLConnection1.StartTransaction(TD);
try
Amt := StrToInt(AmtEdit.Text);
Debit.Params.ParamValues['Amount'] := Amt;
Credit.Params.ParamValues['Amount'] := Amt;
SQLConnection1.Commit(TD);
{on success, commit the changes};
except
SQLConnection1.Rollback(TD);
{on failure, undo the changes};
end;
end;
end;