Skip to content

MSSQLServer and RQL with Offset/Fetch throws exceptions #565

@Voscha

Description

@Voscha

The following RQL from the sample "activerecord_showcases" throws an exception with MS SQLServer:

cRQL2 = 'and(eq(City,"Rome"),or(contains(CompanyName,"GAS"),contains(CompanyName,"Motors")))';
...
lCustList := TMVCActiveRecord.SelectRQL<TCustomer>(cRQL2, 20);

because the resulting SQL has no ORDER BY clause:

'SELECT id, code,description,city,rating,note FROM customers WHERE ((city = ''Rome'') and ((LOWER(description) LIKE ''%gas%'') or (LOWER(description) LIKE ''%motors%''))) /*limit*/ OFFSET 0 ROWS FETCH NEXT 20 ROWS ONLY'

Offset/Fetch have to be used with the order by clause, I think this must be done in the SQL generator of MS SQLServer.

Metadata

Metadata

Assignees

Labels

acceptedIssue has been accepted and inserted in a future milestoneas-designedThe behaviour is correct/expectedenhancement

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions