regression - bug preparing statement
Posted: Fri 29 Mar 2019 08:17
Using c++ builder XE 10.2, unidac 7.4.12, vcl, connection to oracle 12.2 EE in direct mode.
TUniQuery: When sql statement is modified, calling "Prepare()" method doesn't add params array if property ParamCheck is false.
On a form, drop a TOracleUniProvider, a TUniConnection, connect it to an oracle database, direct mode, UnicodeEnvironment=true.
Drop a TUniQuery with sql: select * from cec.natures where id=1 (use the table you want). Set ParamCheck to false.
Drop a TUniButton, set this code in OnClick event:
You will get an error when clicking button: Project Project102.exe raised exception class EArgumentOutOfRangeException with message 'Argument out of range'. We didn't get this issue with previous releases.
However, if sql is not modified: so set SELECT * from cec.NATURES WHERE ID=:1 in component and remove the UniQuery1->SQL->Text=..., Prepare() works and statement can be run!
I agree that params should not be added automatically when statement is changed but Prepare() should create the parameters array in this case, no????
TUniQuery: When sql statement is modified, calling "Prepare()" method doesn't add params array if property ParamCheck is false.
On a form, drop a TOracleUniProvider, a TUniConnection, connect it to an oracle database, direct mode, UnicodeEnvironment=true.
Drop a TUniQuery with sql: select * from cec.natures where id=1 (use the table you want). Set ParamCheck to false.
Drop a TUniButton, set this code in OnClick event:
Code: Select all
UniQuery1->SQL->Text="SELECT * from cec.natures WHERE ID=:1";
UniQuery1->Prepare();
UniQuery1->Params->Items[0]->AsInteger=1;
UniQuery1->Active=true;
However, if sql is not modified: so set SELECT * from cec.NATURES WHERE ID=:1 in component and remove the UniQuery1->SQL->Text=..., Prepare() works and statement can be run!
I agree that params should not be added automatically when statement is changed but Prepare() should create the parameters array in this case, no????