Erro no MySQL com Zeos
Estou utilizando Delphi X6 / MySql 5 / Zeos 7.2.6
Tenho esta rotina em um programa, e está funcionando perfeitamente.
zTable.Filter := ''CODBANC = '''''' + mBanco + '''''' '';
zTable.Filtered := True ;
zTable.IndexFieldNames := ''PREVPARA, D_C, ID'' ;
zTable.Open ;
mSaldo := 0 ;
zTable.First ;
while not zTable.eof do begin
mSaldo := mSaldo + zTable.FieldByName ( ''VALORC'' ).AsFloat -
zTable.FieldByName ( ''VALORD'' ).AsFloat ;
zTable.Edit ;
zTable.FieldByName ( ''SALDO'' ).AsFloat := mSaldo ;
zTable.ApplyUpdates ;
zTable.Next ;
end;
zTable.Filtered := False ;
zTable.Close ;
Quando coloquei a mesma rotina em outro programa, recebo a seguinte mensagem:
0 record(s) updated. Only one record should have been updated.
Já tentei de tudo, mas não consigo resolver.
No Portal Zeos Lib, tem o seguinte:
For Zeos 7.2 please add the following line to your TZConnection.
Properties:
CLIENT_FOUND_ROWS=1
This will enable the CLIENT_FOUND_ROWS option which will change
the behaviour of MySQL according to the documentation in the link
https://dev.mysql.com/doc/refman/8.0/en/mysql-affected-rows.htm.
Não sei como fazer isto.
Obrigado.
Tenho esta rotina em um programa, e está funcionando perfeitamente.
zTable.Filter := ''CODBANC = '''''' + mBanco + '''''' '';
zTable.Filtered := True ;
zTable.IndexFieldNames := ''PREVPARA, D_C, ID'' ;
zTable.Open ;
mSaldo := 0 ;
zTable.First ;
while not zTable.eof do begin
mSaldo := mSaldo + zTable.FieldByName ( ''VALORC'' ).AsFloat -
zTable.FieldByName ( ''VALORD'' ).AsFloat ;
zTable.Edit ;
zTable.FieldByName ( ''SALDO'' ).AsFloat := mSaldo ;
zTable.ApplyUpdates ;
zTable.Next ;
end;
zTable.Filtered := False ;
zTable.Close ;
Quando coloquei a mesma rotina em outro programa, recebo a seguinte mensagem:
0 record(s) updated. Only one record should have been updated.
Já tentei de tudo, mas não consigo resolver.
No Portal Zeos Lib, tem o seguinte:
For Zeos 7.2 please add the following line to your TZConnection.
Properties:
CLIENT_FOUND_ROWS=1
This will enable the CLIENT_FOUND_ROWS option which will change
the behaviour of MySQL according to the documentation in the link
https://dev.mysql.com/doc/refman/8.0/en/mysql-affected-rows.htm.
Não sei como fazer isto.
Obrigado.
José Bettega
Curtidas 0