QueryRecCount with SQL Server
Posted: Thu 12 Nov 2015 14:56
{UniDac 6.1.5}
Hi,
I've got a query like this to run on a SQL Server:
If the QueryRecCount property is not activated, the query is run successfully.
But, when the property is activated, TUniQuery complains about a bad syntax near '(' when asking for the record count.
Indeed, the generated query is:
It seems _SetOrderBy procedure in CRParser unit doesn't support "calculated" order by.
A way to get my query run is to enclose each order by "calculated" field with parenthesis.
It would be convenient that this workaround is not mandatory.
Hi,
I've got a query like this to run on a SQL Server:
Code: Select all
select * from t1 order by right(f1, 3) desc
But, when the property is activated, TUniQuery complains about a bad syntax near '(' when asking for the record count.
Indeed, the generated query is:
Code: Select all
SET :PCOUNT = (SELECT COUNT(*) from t1 right(f1, 3) desc)
A way to get my query run is to enclose each order by "calculated" field with parenthesis.
It would be convenient that this workaround is not mandatory.