Query operations
A view path path is an operation path referring to several built-in query operations. Built-in query operations are all operations, which are allowed in an OSI SELECT statement including some ODABA specific extensions. SELECT is considered as query operation as well.
Syntactically, built-in query operations sometimes differ from other operation calls in more complex parameter lists (as e.g. SELECT or GROUP BY ). Therefore, one should check the reference manuals (OSI Language Reference) carefully.
ODABA supports view definition as view path but also as classical SELECT statement. Using access path provides, however, more flexibility. The general structure of a SELECT statement would be like:
SELECT ( assignment rules )
FROM ( source )
WHERE ( precondition )
ORDER [BY] ( key definition )
GROUP [BY] ( grouping rules )
HAVING ( postcondition );
HAVING and WHERE do both expressing a filter condition in the context of the preceding operand. Hence, in a view path one may use WHERE always instead of HAVING . Instead of SELECT , the view path may refer to a predefined view via USE . Finally, the FROM clause is typically replaced by an access path (e.g. property reference), which provides much more flexibility. For multiple set operations, the FROM operator acts like a set product operation. In a view path, the query specification looks differently, since the view path (operation path) implies a processing order from left to right:
- FROM( source ).ORDER BY( key definition ).SELECT( assignment rules ).
- WHERE( precondition ).GROUP BY( grouping rules ).WHERE( postcondition );
In addition, view paths definitions support several built-in query functions:
JOIN - Join two collections
UNION - Union two collections
INTERSECT - Intersect two collections
TO FILE - Redirect output to file
TO DATABASE - Store output to database
FROM FILE - Redirect input to file
USE - Predefined assignment rules (replaces SELECT )
Besides the view operations mentioned above, other operations or properties might be referenced within the path. Each path element represents an independent generic operation, which can be called with any collection. As long as the result of a path element is a collection, one may extent the view path by further elements.
Since view paths is a sequence of set of OSI operations, the view path is just a special operation path. In other words, each operation path may contain any number of view operations.