Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anything better than $ operator?

Status
Not open for further replies.

JBalcerzak

Programmer
Sep 5, 2002
73
US
Hello -

I'm trying to filter a table based on part of a character description. Currently I'm using something similar to:

set filter to "CHEESE" $ PRODUCT_NAME

to filter on records that contain "CHEESE" in their product names. Anyone have an better ideas? I can't think of a good way to rushmore optimize this for better performance and I've got about 15,000 records in my table which can bog my app down somewhat...

Thanks!
 
LIKE() ?

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE products && Open Products table

CLEAR
? 'All product names with first two letters Ch:'
?
SCAN FOR LIKE('Ch*', prod_name)
? prod_name
ENDSCAN
USE

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
You could also use

set filter to AT("CHEESE", PRODUCT_NAME ) > 0

but I don't know if it would be faster.


Jim
 
Hi JBalcerzak

Ther hardly anything you can do on the RUSHMORE with that sort of requirement.

However, in a large database, if SET FILTER is used, the user gets a screen full of Grid info and then, he presses pag-down, it is likely that he has to wait a long time for the next screen-full or again presses page-up for the previous screen full. To avoid such a user inconvenience,
a better way will be..

SELECT * FROM myTable WHERE myCharVar $ myFieldName ;
INTO CURSOR myCursor
Now browse this myCursor.. you will be fast with scrolling, though the initial fetch will depend on the size of database. I prefer this method than using FILTERS, since the table will be intact for use without filters.

:)



ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top