Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index tag on two integ fields
Message
 
 
To
22/09/2017 20:06:53
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01654503
Message ID:
01654505
Views:
48
>>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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform