Page 1 of 1

regression - bug preparing statement

Posted: Fri 29 Mar 2019 08:17
by albourgz
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:

Code: Select all

    UniQuery1->SQL->Text="SELECT * from cec.natures WHERE ID=:1";
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????

Re: regression - bug preparing statement

Posted: Tue 02 Apr 2019 14:51
by MaximG
The behavior you describe is correct. When working with queries containing parameters in UniQuery, Params array will be either created automatically (when ParamCheck=True), or each parameter of the query should be created manually (when ParamCheck=False). For more information, please refer to: ... mcheck.htm

Re: regression - bug preparing statement

Posted: Wed 03 Apr 2019 07:56
by albourgz
It is correct to say that array will not be created when changing statement.
What is not correct is that when calling Prepare(), it should be created, as it was in previous releases.

Re: regression - bug preparing statement

Posted: Tue 09 Apr 2019 13:37
by MaximG
Please specify the previous version of our components in which the prepare method worked as you described.

Re: regression - bug preparing statement

Posted: Wed 10 Apr 2019 08:29
by albourgz
7.3.10 and earlier.

Re: regression - bug preparing statement

Posted: Wed 10 Apr 2019 10:04
by MaximG
We tested the work of UniDAC 7.2.7 according to your description and found no problems. Please compose and send us the simplest full sample that demonstrates the ParamCheck behavior. You can send the sample using the contact form at our site: