Script wrapper nickname options
You can specify options when you create a nickname for a script. Only the root nickname can include input columns.
Nickname options
The following list describes the nickname options:
- DATASOURCE
- The name of the script that will be invoked. The script must be listed in the script daemon configuration file. This option is required for data sources in the parent nickname. This option applies only to the root nickname.
- NAMESPACES
- A comma-separated list of name=value pairs that the wrapper uses to resolve namespace prefixes in the nickname XPath expression.
- TIMEOUT
- The maximum time, in minutes, that the script wrapper waits for results from the script daemon. The default value is 60 minutes. This option applies only to the root nickname.
- VALIDATE
- Specifies whether the XML source document must be validated before the XML data is extracted. If this option is set to YES, the DB2® database system verifies that the structure of the source document conforms to an XML schema or to a document type definition (DTD). This option is accepted only for columns of the root nickname (the nickname that identifies the elements at the top level of the XML document). The default value is NO.
- STREAMING
- Specifies whether the XML source document is separated into logical fragments that correspond to the node that matches the XPath expression of the nickname. The script wrapper then processes the XML source data fragment by fragment, reducing total memory use. This option is accepted only for columns of the root nickname (the nickname that identifies the elements at the top level of the XML document). The default streaming value is NO. Do not set the STREAMING parameter to YES if you set the VALIDATE parameter to YES.
- XPATH
- An XPath expression that identifies the XML element that represents individual tuples in the data source. The wrapper evaluates the XPATH nickname option for a child nickname in the context of the path that is specified by the XPATH nickname option of the parent nickname. This XPath expression is used as a context for evaluating column values that are identified by the XPATH nickname column options.
Nickname column options
The nickname column options are described in the following:
- DEFAULT
- The default value for an input column. This option applies only to input columns.
- FOREIGN_KEY
- Indicates that this nickname is a child nickname and specifies the corresponding parent nickname.
- INPUT_MODE
- Specifies the input mode for a column. Valid values are CONFIG or FILE_INPUT. The wrapper passes the specified value to the script daemon.
- POSITION
- An integer value for positional parameters. The position sequence order starts at 1. This option applies only to input columns.
- PRIMARY_KEY
- Indicates that this nickname is a parent nickname. The column data type must be VARCHAR(16). A nickname can have at most one PRIMARY_KEY column option. The only valid value is Y.
- SWITCH
- A character string to specify a parameter for the script on the command line. This option applies only to input columns.
- SWITCH_ONLY
- Enables the use of switches without a command line argument.
- VALID_VALUES
- A semicolon-separated set of valid values for a column.
- XPATH
- Specifies the XPath expression in the XML document that contains the data that corresponds to this column. The script wrapper evaluates the XPath expression after the CREATE NICKNAME statement applies this XPath expression from this XPATH nickname option. If you run a query on a column name that has an incorrectly configured XPATH tag reference such as incorrect case, your query returns null values in this column for all returned rows.