![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
JDBC Connect User's Guide
CHAPTER 6
Novell exteNd Composer supports the mapping of data returned by stored procedures. The following sections describes the stored procedure mapping features.
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.
This will enable the Setup... button. Press the Setup... button to display the Setup dialog for Stored Procedure Mapping.
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').
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:
Document – You may use this choice if your result set contains only one row, otherwise each additional row will overwrite the previous row's data.
Detail Alias – A Detail Alias is defined on the Detail Rows tab and consists of a Document name and partial Target XPath. Or the Detail Alias may consist of a Group Alias (defined on the Declare Group/Repeat tab) and partial Target XPath location. Using a Detail Alias tells exteNd Composer to create a new physical target location for each member of the source list (i.e., each row in a result set).
Group Alias – A Group Alias is defined on the Declare Group/Repeat tab and consists of a Document name and partial XPath location. Using a Group Alias tells exteNd Composer to create a new physical target location once for each Group in the source list (i.e., where each group represents multiple rows in a result set).
Repeat Alias – If the Execute SQL action is contained with a Repeat action in your Action Model you may choose its Target alias. In this case, the Context will resolve to a Document and partial XPath to which the Target XPath (see below) will be appended.
-- via standard -- will use the Result Mapping tab's Result Row Placement specification.
-- via custom -- will use the settings on the Custom Mapping Settings dialog.
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.
A result set is mapped to a document with elements created from the result set's column names.
Target element names created in the document are the same as column names returned in the result set
All columns returned in the result set are mapped to the target document
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 ...