Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Major SELECT - SQL logic flaw (mine or VFP?)
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Major SELECT - SQL logic flaw (mine or VFP?)
Miscellaneous
Thread ID:
00018023
Message ID:
00018023
Views:
80
The following statement works under Fox 2.5/dos but fails under VFP 3.0

SELE * FROM sar a WHERE EXISTS ;
(SELE invno FROM invs b WHERE a.invno = b.invno ) ;
OR EXISTS ;
(SELE case_no FROM cases c WHERE c.case_no = a.caseno )

The following statement returns 1 record
SELE * FROM sar a WHERE EXISTS (SELE invno FROM invs b WHERE a.invno = b.invno )

The following statement returns 0 records
SELE * FROM sar a WHERE EXISTS (SELE case_no FROM cases c WHERE c.case_no = a.caseno )

This is the expected behavior. I tried the following statement and it also returns 0 records.
SELE * FROM sar a WHERE EXISTS (SELE invno FROM invs b WHERE a.invno = b.invno ) OR .F.

If the first part of the WHERE evaluates to .T. and it is OR'ed with .F. it should be a .T. statement.

???
Next
Reply
Map
View

Click here to load this message in the networking platform