Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with SQL select and combining cursors/tables
Message
From
04/10/2001 12:10:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/10/2001 10:46:53
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00563768
Message ID:
00564234
Views:
16
2 hrs ??? Actually I even don't expect it to take 6 mins with scan..endscan approach. SQLs use empty() which is not optimizable (I assume you had indexes on left(zip,5) and other - you might replace the !empty(trim(sddmdata.sdaddr)) expression with :
!(sddmdata.sdaddr == '') ).

scan approach does one single pass on one of tables (probably you'd want to choose 8500 recs one) and a do case check. It's almost equivalant to one 'optimized' SQL (preparation of indexes might take time - you might even skip that with one table usage with order set to left(zip,5) tag and do some locate while ...for ... But I think indexes + 3 use again would be faster).

You have unnecessary trimming in comparisons. Instead use set ansi and set exact. You might recover extra time doing so too (and possibly you dont need empty() at all).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform