|
Home >Online Product Documentation >Table of Contents >Creating a collection() Statement Creating a collection() Statement
This topic describes how to create a collection() Function Syntax
The
You can always edit What Happens When You Create a collection() Statement?
You create a
l Automatically creates the collection() statement in the XQuery code based on the table or view you selected
l Registers with the XQuery the connection information for the database associated with the selected table or view, and displays the database in the schema pane of the XQuery Editor, as shown here:
Once the database connection information is registered with the XQuery, you can expand the database nodes in the schema pane to display individual table and view columns. Creating Multiple ConnectionsWhen you drop an object on the editing pane from the File Explorer window, Stylus Studio displays the connection information in the schema pane of the XQuery Editor. If you then drag and drop another object, Stylus Studio either
l Adds a new connection, if the object was from a different server or port
l Modifies the existing connection, if the object is from the same server and port
A new How to Create a collection() Statement
To create a collection() function:
1. Open a new XQuery if one is not already open. The XQuery Source tab should be displayed.
2. Ensure that you have established a valid database connection as described in Creating a Database Connection.
3. In the File Explorer window, expand the database and tablespace to display the tables or views you want to access in your XQuery, as shown in this example:
Optionally, display table and view columns by selecting Read Structure from the table or view shortcut menu (right-click).
4. Drag the desired table or view and drop it on the editing pane of the XQuery Source tab.
Optionally, drop the table or view on the schema pane of the XQuery Source tab. If you do this, you must then drag the desired table or view from the schema pane to the editing pane to create the collection() statement.
Stylus Studio creates the
collection() statement based on the table or view you selected in Step 4. It also displays the table's or view's database in the schema pane of the XQuery Editor (see Figure 368).
|