Data

Views

We can give names to relation expressions by creating views (virtual relvars).

Views

To create a virtual relvar derived from other relations we can use view() to wrap an expression.

S20 := view(S[STATUS=20] & SP)
S20
SNOSNAMESTATUSCITYPNOQTY
S1Smith20LondonP1300
S1Smith20LondonP2200
S1Smith20LondonP3400
S1Smith20LondonP4200
S1Smith20LondonP5100
S1Smith20LondonP6100
S4Clark20LondonP2200
S4Clark20LondonP4300
S4Clark20LondonP5400

The expression is re-calculated each time the view is referenced, so any changes to the referenced relvars will be reflected each time.