Page 1 of 1

Error with CTE (Common Table Expressions)

Posted: Sun 31 Jul 2011 15:12
by sailorman
When I execute the following query I get the assertion error below.

WITH Address(City,Province,Country) AS (
SELECT City,StateProvince,CountryRegion
FROM
SalesLT.Address )
select * from Address

Assertion failure (D:\Projects\Delphi\Dac\SqlServer\Source\OLEDBAccess.pas, line 9743)

Microsoft SQL Server: 10.00.4064
Microsoft OLE DB Provider for SQL Server: 06.01.7601

SDAC Trial Edition
Version 5.10.0.8 for Delphi

Posted: Mon 01 Aug 2011 13:47
by AndreyZ
Hello,

Thank you for the information. We have reproduced the problem and the investigation of the problem is in progress. As soon as we solve the problem we will let you khow.

Posted: Tue 23 Aug 2011 13:56
by Dimon
We have fixed this problem. This fix will be included in the next SDAC build. But OLEDB incorrectly supports queries with the "WITH ... AS" clause when using server cursor. Therefore to solve this problem, you should set the TMSQuery.CursorType property to ctDefaultResultSet.