next up previous
Next: More Complex Examples Up: View Specification Previous: Example

Sample Specification

Suppose the each of the P's have a number of children, where we are only interest in extracting the name and address for our view.

Here is the sequence of commands to create View 1:

Temp1 := Import p, p.Phone, p.Name += 
   Source_From DB d, d.Students s, s.Person P
   where /* Some where clause that extracts o1 and o3 */

Temp2 := Import p, p.Phone, p.Name +=
   Source_From DB d, d.TAs t, t.Current c, c.Person p
   where /* Some where clause that extracts o4 */

Temp3 := Import p, p.Phone, p.Name +=
   Source_From DB d, d.Admin a, a.Members m, m.Person p
   where /* Some where clause that extracts o6 */

Friends := import Temp1.P, Temp2.P, Temp3.P;
Temp1:= oem_nil;
Temp2:= oem_nil;
Temp3:= oem_nil;

or in one statement:

Friends := Import p1, p1.Phone, p1.Name, p2, p2.Phone,
           p2.Name, p3, p3.Phone, p3,Name += 
   Source_From DB d, d.Students s, s.Person P1
   Source_From d.TAs t, t.Current c, c.Person p2
   Source_From d.Admin a, a.Members m, m.Person p3
   where /* Some where clause that extracts o1 and o3 */
     and /* Some where clause that extracts o4 */
     and /* Some where clause that extracts o6 */

Here is the specification for View 2:

Temp1 := Import s, p, p.Phone, p.Name += 
   Source_From DB d, d.Students s, s.Person P
   where /* Some where clause that extracts o1 and o3 */

Temp2 := Import p, p.Phone, p.Name +=
   Source_From DB d, d.TAs t, t.Current c, c.Person p
   where /* Some where clause that extracts o4 */

Temp3 := Import new_oem (TAs : Temp2);

Friends := Import Temp1, Temp3;

  



Jason McHugh
Tue Dec 10 15:35:11 PST 1996