OdataToEntity icon indicating copy to clipboard operation
OdataToEntity copied to clipboard

xml data type cannot be compared or sorted except when using the is null operator

Open JL-Ikosoft opened this issue 2 years ago • 0 comments

Hello :)

Running 2.8.0, does the OData parser adds each fields in the "Order By" SQL request? I have a SQL view named View_MyTable below that i query using OData:

select Id, cast(MY_NTEXT_FIELD as XML) as [MyXmlField] from MyTable

But i receive a xml data type cannot be compared or sorted except when using the is null operator error.

SQL query being executed looks like this:

SELECT TOP(@__p_0) [o].[id], [o].[MyXmlField]
FROM [View_MyTable] AS [o]
ORDER BY [o].[id], [o].[MyXmlField]

The XML data type field should not be used in the ORDER BY clause.

Do you have any idea how to fix this?

Kind regards

JL-Ikosoft avatar May 05 '22 13:05 JL-Ikosoft