Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Statements vs procedural code
Message
From
14/04/2006 11:38:44
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
14/04/2006 09:55:58
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01113707
Message ID:
01113718
Views:
18
>I am in a situation where I'm supporting a 3rd party product that has been modified by our company using strictly procedural code. Originally written in VFP6.0, we are attempting to port to VFP9.0 (but that's another story).
>I have to convince the IT director/coder and the CFO why it's better to use SQL-Select than the procedural code and why it's a bad thing to have over 2 million records in a file. The Select statement takes a much longer time to run than Seek ... Do While.. How can I present this to non-technical people?

It's not bad to have 2 million records in a table. I don't envy you having to try to convince an "IT director"/"coder" of anything. People that are used to using SEEK and DO WHILE often do not know how to squeeze performance out of Rushmore, especially with multi-million record tables. Further, such systems tend to be remote backend hostile. They assume all records are already available, where in remote backends the assumption has to be you get no records until you specify which ones.

The advantages of using SQL lies in the flexibility to provide the user with more search control. If the users want to search for invoices entered sometime last week for a guy with the firstname contains "Ji" ordered by date descending and invoice number ascending, that cannot easily be done with seek/do while code. First they'd have to have a multitude of indexes that anticipate (read LIMIT!!!) the user's searches. Once the users are used to doing things a certain way, they'll not care to back you up either.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform