Loading TOC...

MarkLogic 10 Product Documentation
op:column-info

op:column-info(
   $plan as map:map
) as map:map*

Summary

This function can be used to inspect the state of a plan before execution. It returns the information about each column in the plan, including schema name, view name, column name, data type and nullability. It also returns the information about system columns.

Parameters
$plan The plan to be inspected.

Example

xquery version "1.0-ml";
import module namespace op="http://marklogic.com/optic"
     at "/MarkLogic/optic.xqy";

op:from-view("main", "employees") => op:column-info()

(: results may look like below
{"schema":"opticUnitTest", "view":"musician", "column":"lastName", "type":"string", "nullable":false}
{"schema":"opticUnitTest", "view":"musician", "column":"firstName", "type":"string", "nullable":false}
{"schema":"opticUnitTest", "view":"musician", "column":"dob", "type":"date", "nullable":false}
{"schema":"opticUnitTest", "view":"musician", "column":"rowid", "type":"rowid", "nullable":false}
{"schema":"opticUnitTest", "view":"musician", "column":"__docid", "type":"fraghint", "nullable":false}
{"schema":"opticUnitTest", "view":"musician", "column":"__content", "type":"value", "nullable":false}
:)

  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.