Constructors and Coercion Operators

[This is preliminary documentation and subject to change.]

DBOP_row
Constructs a row from a list of scalar values. Similar to SQL-2's row value constructor from column values or literals, as in "(t.a, t.b, t.c) < VALUES (2, 3, 5)." It takes a scalar_list_anchor as input and produces a single row.
DBOP_table
Constructs a table from a list of union-compatible row constructors. It takes a row_list_anchor as input and produces a table.
DBOP_sort
Sorts a table in increasing or decreasing order according to a list of columns or expressions over its columns. A DBOP_sort has two required child nodes. The first child represents the input table to be sorted. The second child is a DBOP_sort_list_anchor node representing the list of sort keys. Each element of the sort_list, specified by a DBOP_sort_list_element, contains the order of sort in the DBSORTINFO field, and points to the column name or expression on which to sort. This operator produces an ordered table. If the input to sort is a unique table, it produces an ordered-unique table. If the input to sort is a hierarchical table, then the sort operator applies only to the root rowset in that table; that is, the list of columns on which to sort should reference only non-chaptered columns of the root rowset; otherwise, the sort specification is invalid. The output of sort in this case is a hierarchical table with the rows in the root rowset odered. For example: Let T1->T2->T3 be a hierarchical rowset, where the columns of each rowset are T1(A,B,C,X), T2(D,E,F,Y), and T3(G,H), assume X, and Y represent the chaptered columns of T1 and T2, respectively. Assume DBOP_sort specifies a list W of columns on which to sort. W must reference only subsets of {A,B,C}.
DBOP_distinct, DBOP_distinct_order_preserving
These operators remove duplicate rows from a table. The DBOP_distinct operator takes a table as input and produces a unique table. The DBOP_distinct_order_preserving operator takes an ordered or unordered table as input and produces a unique table maintaining the row order of the input table. If the input table is ordered, then the output is an ordered-unique table.