Hi !
I need to use limit and offset in my query but it raises an exception when I call Query.Open. I'm using native TSQLConnection with native TSQLQuery from Delphi XE2 with devart postgresql driver.
I already tested the SQL without limit and offset statments and it works fine.
Any tips about this ?
Thank you
Error using limit and offset
Re: Error using limit and offset
In time... the exception raised is 'List index out of bounds (-1)'
Re: Error using limit and offset
Some more informations about my tests:
Case 1) setting offset=1 --> works fine !
select * from table order by id limit 50 offset 1;
Case 2) removing order by --> works fine !
select * from table limit 50 offset 0;
Case 2) with order by and offset=0 --> raises 'List index out of bounds (-1)'
select * from table order by id limit 50 offset 0;
Please, someone can help me with this ?
Case 1) setting offset=1 --> works fine !
select * from table order by id limit 50 offset 1;
Case 2) removing order by --> works fine !
select * from table limit 50 offset 0;
Case 2) with order by and offset=0 --> raises 'List index out of bounds (-1)'
select * from table order by id limit 50 offset 0;
Please, someone can help me with this ?
Re: Error using limit and offset
Hello,
This problem is due the behaviour of TClientDataSet, not our driver. To solve the problem, you should set the poRetainServerOrder option of TDataSetProvider:
This problem is due the behaviour of TClientDataSet, not our driver. To solve the problem, you should set the poRetainServerOrder option of TDataSetProvider:
Code: Select all
DataSetProvider1.Options := [poRetainServerOrder];