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????