Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT SQL - Opposing Views
Message
From
20/11/1998 11:16:55
 
 
To
20/11/1998 11:12:43
Ernie Veniegas
Micro System Solutions, Inc.
Calistoga, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00159754
Message ID:
00159759
Views:
25
>"Opposing views?"
>
>What would cause a Local View used as the data environment for a FORM to yield a different record set from when in development mode? When I'm in the View Designer and I run the query, I get one group of records; when I'm in the Project Manager and I [Browse] the view, I get the same set of records; ditto if I clip the code to a PRG and run it. But, when I'm in a form that has that view as its data environment, I get different records. (It's the only table in the data environment.)
>
>Here's the sql:
>
>SELECT Test.scan_test, Test.scan_testseq, Student.student_cd,;
> Student.lname, Student.fname, Student.mname, Student.student_id,;
> Student.agency_id, Student.site_id;
> FROM topspro!student INNER JOIN topspro!test ;
> ON Student.student_id = Test.student_id;
> WHERE EMPTY(Test.scan_test) = .F.;
> ORDER BY Test.scan_test DESC, Test.scan_testseq
>
>More info: For testing purposes, my test table has only 7 records in it. The record contain student_id from the student table as a foreign key. (Test records are treated as child records of the student.) But 5 of the 7 test records belong to a student record that's since been been deleted. So outside of the form, the view always shows 2 records, but when I run the form, the view returns all 7 records. (DELETE is set ON in both the form's data environment and in development mode.)
>
>What do I want? I want to see the child records (tests) only if the student they belong to hasn't been deleted.
>
>Am I going about this the wrong way, is there an error in my SQL or is something subtle going on where DELETE is involved, or is there a better/easier way to achieve this?

It looks as you have default SET DELETED setting (off) in your form. It might be if you use private DataSession. If it's so, say explicitly SET DELETED ON in Form.load event.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform