Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL: Internal error.
Message
From
21/05/2001 05:37:48
 
 
To
20/05/2001 23:45:04
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00509312
Message ID:
00509360
Views:
22
>>SELECT * ;
>> FROM loadfile, client ;
>> WHERE NOT EMPTY(loadfile.searchstr1) ;
>> AND UPPER(ALLTRIM(loadfile.searchstr1)) $ ALLTRIM(UPPER(client.company))
>>

Maybe the problem is that both terms of the 'where' clause are being evaluated i.e. the search in is still performed even if loadfile.searchstr1 is empty. Then every record would match (probably). I am aware that VFP evaluates IF terms in order, and stops if the condition isn't met without further testing, but in SQL a different rule might apply. I believe VB's tests don't stop - all conditions are checked.

Possibly if you split the statement into two and create an initial cursor:

Select * from loadfile WHERE NOT EMPTY(loadfile.searchstr1) ;
into cursor curLF1

and then you join this to the second file, it will avoid the problem.

Mike
Regards

Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform