Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index tag on two integ fields
Message
From
23/09/2017 01:23:07
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01654503
Message ID:
01654507
Views:
60
>>>Hi,
>>>
>>>My table has two Int fields. I want to create an index tag so that I can use SEEK() with two Int values.
>>>Example:
>>>table has fields FLD1 Int, FLD2 Int.
>>>Two variables iVar1 and iVar2
>>>
>>>
>>>if seek( ..... )
>>>
>>>endif
>>>
>>>
>>>what would the the expression?
>>>
>>>index on ....    FLD1 ..... FLD2 ... TAG tagName
>>>
>>
>>You could convert to CHAR and concatenate e.g.
>>
>>INDEX ON STR( Fld1 ) + STR( Fld2 ) ...
>>
>>but if you do that you'd need to SEEK on STR( Fld1 ) + STR( Fld2 ).
>>
>>I'd be inclined to just index the columns individually, to separate tags, then use LOCATE:
>>
>>LOCATE FOR Fld1 = iVar1 AND Fld2 = iVar2
>>
>>The latter approach should be fully Rushmore optimizable. I don't know whether the first one would be faster or slower.
>
>Thank you. The speed is not important for this. I am just converting some .DBFs to SQL server.

In that case the order shouldn't be important at all. On SQL server there is no such thing as "natural order" of the records anyway.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform