User Guide > Procedures > XQuery Procedures > Designing Parameters for an XQuery
 
Designing Parameters for an XQuery
If you want to create a script by first designing its parameters, you must design the parameters in the Parameters Panel and then write a procedure in the XQuery panel.
For more on execution, see Executing a Procedure or Parameterized Query.
To design the parameters for an XQuery in the Parameters panel
1. Create a new XQuery procedure as described in XQuery Procedures.
2. Select the Parameters tab.
3. Check the Design Mode check box at the top right to make the Parameters panel editable.
4. Click the Add button to start adding parameters, and select a data type.
When you click Add and select a data type, a new parameter is added with a default name and the specified data type.
Supported data types are:
Binary—BINARY, BLOB, VARBINARY
Decimal—DECIMAL, DOUBLE, FLOAT, NUMERIC
Integer—BIGINT, BIT, INTEGER, SMALLINT, TINYINT
String—CHAR, LONGVARCHAR, VARCHAR
Time—DATE, TIME, TIMESTAMP
Complex—CURSOR, XML
The Browse option is for choosing a definition set. See the topic Definition Sets, for details on definition sets.
5. Right-click the parameter name, choose Rename, and type the new name.
6. Optionally, change a parameter’s data type:
a. Right-click the data type name and select Change Type.
b. Right-click the parameter name or data type, and select a data type from the drop-down list.
c. Optionally, specify the length or the number of digits for certain data types.
d. Click OK.
7. Select the parameter, and click Cycle I/O Direction to indicate whether the parameter is input, output, or both.
The Cycle I/O Direction button is not available for parameters that are part of a cursor.
8. Use the navigation buttons to move a parameter up, down, left, or right.
The up and down navigation buttons are enabled when there is more than one parameter.
The left navigation button is enabled for a CURSOR parameter. The right navigation button is enabled for a parameter in a row immediately after the last parameter in a CURSOR. After specifying all of the parameters you want to define, save the edits.
9. In the XQuery panel, complete the procedure using the parameters designed in the Parameters panel.
10. Save the procedure.
After the parameters in the design match the parameters in the script on the XQuery panel, the name of the script is displayed in black.