Recid -> cursor.position?

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Wed Nov 11 08:46:15 CST 2009


On 11/11/09 12:11 PM, "Thomas Flemming" <tf at ttqv.com> wrote:

> Hi,
> 
> somehow I'm struggeling with this:
> 
> I have a cursor: ("select * from tbl where blabla order by field2")
> 
> Now I have a specific record, but only its RecID from the table. How can I get
> the cursor.position of this record?

There is no simple way.

RecID of record and position are different things.

If you have cursor sorted on RecID (default if no ORDER BY),
Then best thin you can do -- apply binary search by RecID,
To find record inside of cursor.
    

**********
If cursor is not sorted by RecID, then you can improve seed of search usng
addional Map <RecID, pos>.

To build such map, you need do iteration by single column of cursor ONCE.

This is solution is fine of course if no millions of recs in the cursor

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list