QueryRecCount error when query uses PLAN
Posted: Fri 30 Mar 2012 10:48
I have a situation where query uses PLAN clause and QueryRecCount is set to True. When I open the query, exception is raised because the PLAN clause stays in a SQL which retrieves record count.
This happens because ORDER BY clause is removed but in PLAN clause stays a primary key to use in ORDER BY. The PLAN clause should be removed in this new query.
Example:
SELECT
FROM table1 t1
JOIN table2 t2 ON
PLAN JOIN (t2 ORDER PK_table2, t1 INDEX (PK_table1))
ORDER BY
This produces an error when opening query.
Version of UniDAC we are using is 4.1.5.
This happens because ORDER BY clause is removed but in PLAN clause stays a primary key to use in ORDER BY. The PLAN clause should be removed in this new query.
Example:
SELECT
FROM table1 t1
JOIN table2 t2 ON
PLAN JOIN (t2 ORDER PK_table2, t1 INDEX (PK_table1))
ORDER BY
This produces an error when opening query.
Version of UniDAC we are using is 4.1.5.