Generic Limit and Offset (Pagination)

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FarshadV
Posts: 22
Joined: Sat 31 Jan 2009 21:55

Generic Limit and Offset (Pagination)

Post by FarshadV » Wed 07 Apr 2010 12:30

Is there a generic Limit & Offset command which uniDAC will translate to the proper format for the target database system?


Best Regards,

Farshad R. Vossoughi

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 08 Apr 2010 14:52

UniDAC is universal. Limit & Offset commands are supported only by several databases. That's why we did not implement support for Limit & Offset commands in UniDAC.

But you can use macros to use Limit & Offset commands:

UniQuery.SQL:= 'SELECT * FROM Dept &LimitAndOffset';

And define them depending on the current database:

if UniConnection.ProviderName = 'MySql' then
UniQuery.MacroByName('LimitAndOffset').Value:= 'LIMIT 10 OFFSET 10'
else if UniConnection.ProviderName = '...' then
...
else
UniQuery.MacroByName('LimitAndOffset').Value:= '';

FarshadV
Posts: 22
Joined: Sat 31 Jan 2009 21:55

Post by FarshadV » Fri 09 Apr 2010 13:28

Thank you very much

Best Regards,

Farshad R.Vossoughi

Post Reply