JDBC Connect User's Guide

CHAPTER 6

Stored Procedures

Novell exteNd Composer supports the mapping of data returned by stored procedures. The following sections describes the stored procedure mapping features.

 
Top of page

About Stored Procedure Mapping

Novell exteNd Composer allows for mapping the data returned by stored procedures to DOM/Node combinations. To do so, select the Stored Procedure mapping checkbox on the Result Mapping tab in the Query/Results Mapping Pane.

ResultsMapping2

This will enable the Setup... button. Press the Setup... button to display the Setup dialog for Stored Procedure Mapping.

StoredProcedureSetup

 
Top of page

Binding Rules

It is important to understand exteNd Composer binds to all Expressions and placeholders represented by Question Marks placeholders (e.g. either `:<expression>' or ? ) but not Constants (e.g. `abc').

 
Top of page

Using the Stored Procedure Mapping Setup Dialog

The Stored Procedure Mapping Setup dialog is used to map the data returned by a stored procedure. The Setup dialog allows you to specify Context - Target XPath combinations for the returned data.

Use the + and - controls to add and delete Context - Target XPath combinations.

Oracle RDBMSs return result sets as parameters. Non-Oracle RDBMSs return result sets but, not as parameters. Select the Returns Result Set check box when result sets are returned by non-Oracle RDBMSs. Selecting the Returns Result Set check box for non-Oracle RDBMSs enable exteNd Composer to find the returned result set.

NOTE:   All Expressions and placeholders (e.g. ?) must be specified in the Stored Procedure Mapping Setup dialog in order to correctly map the returned data.

For each returned Input/Output parameter (which may be expressions) and each Output parameter (which may be either an expression or a ?) (see the Rules for Stored Procedures section in Chapter 4), complete the following:

Id: Based on the SQL parameters, Id is the number sequence of the return values you're expecting. Using Id, you will need to explicitly specify the sequence positions of each of the parameters containing either expressions (e.g. `:<ExpressionName>') or placeholders (e.g. ?). For example, the following procedure call has three parameters: a constant, `Process', a placeholder, ? and an expression, `:Smith'. The value `Process' does not need an Id in the Stored Procedure Mapping pane since exteNd Composer does not bind to values. The Id entries for the placeholder - ? and the variable `:Smith' are, respectively, 2 and 3. exteNd Composer binds to variables and placeholders, therefore, they must be specified in the Stored Procedure Mapping pane in order to properly map the data returned by a stored procedure.

Example:

  { call DemoPackage.sp_withParams('Process', ?, ':Smith') }

Qual: Qual qualifies the parameter as an Input parameter, an Output parameter or as an Input/Output parameter.

Data Type: Data Type is a drop down list which provides the following options: VARCHAR, DECIMAL, DATE, BINARY or Oracle Result Set. When Oracle Result Set is selected as an Input parameter (Qual=In), Context and Target XPath do not apply (N/A) and are, therefore, disabled.

Scale: The value of Scale specifies the decimal place precision.

Map: The Map checkbox is selected to map the parameter.

Context: this specifies the target document for the column. The Target XPath will be appended to the Context to produce the full XPath location for the column in the target document. The Context can be a:

When grouping and mapping detail column data, the Declare Group/Repeat, Detail Rows, and Map Target tab work together to define the complete XPath location for the column. (See illustration.) For instance, a column on the Map Target tab will be represented by a Context and XPath. The Context may be a Detail Alias defined on the Detail Rows tab. The Detail Alias in turn will represent another Context and XPath. Its Context may be a Group Alias defined on the Declare Group/Repeat tab. Finally the Group Alias itself will represent another Context and XPath.

By defining the Group and Detail aliases separately, you are able to map rows with duplicate column data (the basis for your groups) just once into group header elements by using the Group alias as a context, and map columns with unique data (the detail of your groups) multiple times within the group header elements by using a Detail Alias whose Context is a Group Alias.

Target XPath: This is an XPath fragment which will be appended to Context to specify the full XPath location int the target document.

 
Top of page

Returned Result Set

A result set is mapped to a document with elements created from the result set's column names.

NOTE:   Any column names that contain spaces will have the spaces replaced with an underscore character since XML does not permit spaces in element names.




Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...