Page 1 of 1
Problem with duplicated params when using a parameter multiple times in a query text
Posted: Tue 16 May 2017 07:30
by ezijp
When I set the SQL text of a TMSQuery component with a SQL statement that uses a parameter multiple times like for example
Code: Select all
select *
from mytable
where COALESCE(DVALIDFROM, :PeriodTo) <= :PeriodTo
then the params property contains the PeriodTo twice. Is this the intended behaviour? Or am I missing a setting? This behaviour differs from the behaviour we are used to from UniDAC.
When the parameters are duplicated I get a 'required parameter not set' error when I try to execute the query.
Kind regards,
Erik
Re: Problem with duplicated params when using a parameter multiple times in a query text
Posted: Wed 17 May 2017 08:57
by azyk
The specified dataset parameters behavior in SDAC is correct.
You can leave your suggestion about implementation of SDAC dataset parameters behavior, as in UniDAC at our UserVoice (
http://devart.uservoice.com/forums/1046 ... components ). If the suggestion receives enough votes we will consider its implementation.
Re: Problem with duplicated params when using a parameter multiple times in a query text
Posted: Thu 18 May 2017 11:44
by ezijp
Thanks for the clarification. I created an item for this at your UserVoice:
https://devart.uservoice.com/forums/104 ... a-paramete
This behaviour makes accessing the parameters by name useless when you have a parameter that is used multiple times in a query. The behaviour is also different from the standard TIBQuery and TSQLQuery component that come with Delphi.
As long as this behaviour is not changed SDAC is unusable for us.
Kind regards,
Erik
Re: Problem with duplicated params when using a parameter multiple times in a query text
Posted: Fri 19 May 2017 09:12
by azyk
This SDAC behavior is used by many users, therefore we will be able to consider a possibility of its change if there is a sufficient number of votes at UserVoice.