Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why the difference?
Message
 
 
To
26/06/2001 22:21:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00523778
Message ID:
00524088
Views:
16
Since you are gathering selection criteria entered by the user, I am lead to think you are retrieveing records for the user to select from for editing purposes. If this is so, I highly recommend doing what I do. I also have an inquiry form for my users where I then create SQL on the fly to select records with. I then use SPT to retrieve a cursor, not a view stored in a DBC. I actually store this generated SQL in a global app, goAPP, property. The user is then sent to a form with a grid to display the cursor created by the generated SQL. In the form LOAD, I get the generated SQL string from the goApp property and use SQLEXEC() to retrieve the data. The SQL also contains the PK field. This type of query is very fast and can be optimized depending on what you allow for search criteria.

They then select a record from the grid, the PK of the record is stored in a goApp property and an editing form is then run.

Instead of using where descript $upper(somefield), you can partially optimize this by using where upper(somefield) like ?cValue as long as cValue = upper(alltrim(ThisForm.txtBox1.Value)) + '%' You can also use a % at the beginning or the underscore wild card where needed.

Since you are using local data, just execute the SQL INTO CURSOR crsResults instead of using SQLExec. I use Oracle, and this technique really cooks. Plus, there are just some things your users just have to realize -- the more general their search criteria are, the less effecient the retrieval.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform