Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need assistance optimizing a select statement
Message
From
02/12/2003 13:16:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Need assistance optimizing a select statement
Miscellaneous
Thread ID:
00855104
Message ID:
00855104
Views:
49
Hi,

I have a .net applicaition whose data store are 50 old fpw26 free tables. UPDATES, INSERTS and DELETES are working just fine. One of my SELECT statements is a little slow and I am sure that it is because the VFP engine connected to ado.net does not like the lack of optimization. I build the pieces to my select statment on the fly just before I send it. tcLastNameFragment is passed to my GetListFromNameFragment method as a parameter.
DataSet GetListFromNameFragment(string tcLastNameFragment)
{
  Ufrag = '%'+UPPER(tcLastNameFragment)+'%' ;
  cnLEN = TRANSFORM(LEN(tcLastNameFragment));
  SUBY = " SUBSTR(UPPER(title),1," + cnLEN + ") like '" ;

  lcSelectStatement = "SELECT * From c:\patients.dbf WHERE" + SUBY + Ufrag + "'" ;
   
   more code ........
If I pass "GOR" to the method, the select statement will return 3 the following 3 names as it should:
GORE
GORIN
GORY

If I pass in "T" to the method, every name that starts with "T" is found.
Select statement works but lacks opitimization.

Any thoughts?
Neil
Next
Reply
Map
View

Click here to load this message in the networking platform