Yes, I just write some simple code to test and you are right
Below is the test code.
---------------------------------
procedure TForm1.Button1Click(Sender: TObject);
begin
SQLQuery1.Options := SQLQuery1.Options - [sqoAutoCommit];
SQLQuery2.Options := SQLQuery2.Options - [sqoAutoCommit];
SQLQuery1.SQL.Text := 'select * from table_a';
SQLQuery1.open;
while not SQLQuery1.EOF do
begin
SQLQuery2.SQL.Text := 'select * from table_b';
SQLQuery2.Open;
while not SQLQuery2.EOF do SQLQuery2.Next;
// THIS LINE MAKES SQLQuery1.Fields.Count = 0
TSQLTransaction(SQLQuery2.Transaction).Commit;
// if the above line removed, there will be no problem
if SQLQuery1.Fields.Count = 0 then
ShowMessage('Query1 fields lost!');
SQLQuery1.Next;
end;
TSQLTransaction(SQLQuery1.Transaction).Commit;
end;