op:view-col( $viewName as string?, $colName as string ) as map:map
Identifies a column where the combination of view and column name is unique. Identifying the schema isn't necessary (and it might not exist).
If the combination of view and column name is not unique, an ambiguous column error is thrown.
Parameters | |
---|---|
$viewName | The name of the view. |
$colName | The name of the column. |
xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; let $employees := op:from-view("main", "employees") let $expenses := op:from-view("main", "expenses") return $employees => op:join-inner($expenses, op:on(op:view-col("employees", "EmployeeID"), op:view-col("expenses", "EmployeeID"))) => op:select((op:view-col("employees", "EmployeeID"), "FirstName", "LastName", "Category")) => op:order-by(op:view-col("employees", "EmployeeID")) => op:result()