Getting specific record number

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Jul 18 21:56:11 CDT 2003


on 7/18/03 19:43, Mark Maslowski at mark at majico.com wrote:

>> Is myCursor.currentPosition what you're looking for?
> 
> I don't think so. Let me see if I can explain it better.
> 
> The project is a clothing catalog CD. Let's say the user uses the menu to
> select Mens Shirts > Polo. I display the record information for this product
> by creating a cursor with WHERE shirt_style = 'polo'. This creates a cursor
> with a single record. However, the client want the user, with a back and
> next button, to be able to step though and display the products in Mens
> Shirts. So, I need to find out where the current product, Polo Shirt, is
> within the larger cursor of Mens Shirts so that I can do a NextRecord or
> PreviousRecord from that point.
> 
> Did that help?

I think you need to do next:

1) using that cursor with single record define RecID of that record.

    SELECT RecID ... WHERE fld = 'polo'

2) Now in your bigger cursor you need to have records sorted by RecID.
They are such if you do not specify own ORDER BY.

Now you can easy and fast enough locate that record in big cursor using
binary search on RecID field. YES, you need self do binary search.
Even for million records cursor you will need just 20 steps to locate
record. 

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list