Starting fetch from last row

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
KalemSayat
Posts: 4
Joined: Mon 11 Oct 2010 07:46

Starting fetch from last row

Post by KalemSayat » Mon 11 Oct 2010 08:20

Hi;

We have a large market in our country. Our customers are already using our solitions.
In only one year we achieved a rapid increase in our customer databeses and 500 million new data have been processed during this period of time.

We decided to use SDac component (because our datas are coming slowly and your component has fetch property), so we are testing your trial version of sdac. If your product satisfies our needs
we are willing to purchase it.

But there is a problem which we don't know how to solve it.
The problem is : We want to begin fetching in grid from last row.

before using sdac we are using a code like:
ADOQuery1.SQL.Text := 'SELECT * FROM SLT_INVOICE_001';
ADOQuery1.Open;
ADOQuery1.Last;


in now when i use SDAC with fetchall property false:
MSQuery1.Open;
(Sounds like good, everythink is good, fetching record properly.)

we want to begin fetching from last row.
when i use MSQuery1.Last;
the component gets all of records.
it shouldn't get all of data when i use MSQuery1.Last
According to us we must fetching records from last row.

Is there a property like :
MSQuery1.FetchAll := False;
MSQuery1.FetchFromLastRow: True;
MSQuery1.Open; ( like scrolls last row.)

How can we solve that problem?
We wish we can come to a solid soluiton by our approchement .

Thanks for your relation
Best Regards

AndreyZ

Post by AndreyZ » Mon 11 Oct 2010 10:44

Hello,

You can add reverse sorting in you sql. Here is an example:

Code: Select all

  SELECT * FROM SLT_INVOICE_001
  ORDER BY ID DESC

KalemSayat
Posts: 4
Joined: Mon 11 Oct 2010 07:46

Post by KalemSayat » Mon 11 Oct 2010 11:02

AndreyZ wrote:Hello,

You can add reverse sorting in you sql. Here is an example:

Code: Select all

  SELECT * FROM SLT_INVOICE_001
  ORDER BY ID DESC
Thanks for your relation. But that is not a solition for us. We want to show last record in grid last row not first row.

i think it should be technically possible.

The component will also a property. Like FetchFromLastRow = True
That property goes last row automaticly(not waiting it should work like when i open my query with FetchAll = false) when i open Query (MSQuery1.Open;)
and when i scroll page up it should began fetching.


Do you understand what i want to do?

AndreyZ

Post by AndreyZ » Mon 11 Oct 2010 12:12

SDAC doesn't support this functionality. We will investigate the possibility of adding this functionality in the future. As soon as we solve this question we will let you know.

KalemSayat
Posts: 4
Joined: Mon 11 Oct 2010 07:46

Post by KalemSayat » Mon 11 Oct 2010 12:59

Thank you for your interest. This is very important issue for us. Expect good news.

Best Regards

AndreyZ

Post by AndreyZ » Mon 25 Oct 2010 08:46

We have investigated the problem. We cannot add this functionality because SQL Server doesn't support it. But you can use the ctKeyset or ctStatic cursors to increase performance when you need to go to the last record without fetching all records.

Post Reply