Cursor.FindSingleValue

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Mon Dec 28 15:09:46 CST 2009


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

>>     and then in cursor you can do binary search by that field values.
> 
> what is "binary search by that field value"  ?

If you will sort cursor by e.g. Field "name" then you get something as

  aaa ......
  bbb ....      
  ccccc
  dddd

Right?

So you get SORTED ARRAY. Right?

This means you can do binary search.
I hope you know what is binary search :)


> Ruslan Zasukhin schrieb:
>> On 12/28/09 4:36 PM, "Thomas Flemming" <tf at ttqv.com> wrote:
>> 
>>> When I do it like this, it works, but of course slow on large cursors:
>>> 
>>>    For i As Integer = 1 To mCursor.RecordCount
>>>       mCursor.Position = i
>>>       If mCursor.Field("name").Value = name1 Then Return mCursor.Position
>>>    Next
>>> 
>>> Where am I wrong ?
>>> How do I get the cursor.position of a specific record fast ;-)
>> 
>> * better faster to use not .pos =
>> But cursor.NextRecord
>> 
>> 
>> * why you need to search cursor?
>> 
>> * only one field to search?
>>     if yes, then may be ORDER BY name
>>     and then in cursor you can do binary search by that field values.

-- 
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