bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Building Queries and Data Views

 Previous Next Contents Index View as PDF  

Stored Procedure Description File Schema

The Stored Procedure Description file is an XML file that defines stored procedures to Liquid Data. This section describes the schema of the Stored Procedure Description file, and contains the following sections:

For sample Stored Procedure Description files, see Sample Stored Procedure Description Files.

Basic Structure

The Stored Procedure Description file has the following main sections:

Type Definitions

The type definitions section of the Stored Procedure Description file is defined in the <types> element. This element defines namespaces and complex types for the stored procedures defined in the Stored Procedure Description file.

Function Definitions

The function definitions section of the Stored Procedure Description file is defined in the <functions> element. Within the <functions> element are <function> elements, each of which defines the signature of a stored procedure. You can define one or more stored procedures in a single Stored Procedure Description file.

Schema Definition File for Stored Procedure Description File

The following is the schema definition file for the Stored Procedure Description file:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="definitions">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="types"/>
<xsd:element ref="functions"/>
</xsd:sequence>
<xsd:attribute name="targetNamespace" use="optional"
                                         type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="types">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="schema"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="schema" type="xsd:anyType"/>
<xsd:element name="functions">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="function" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="function">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="argument" minOccurs="0"
                                           maxOccurs="unbounded"/>
<xsd:element ref="presentation" minOccurs="0"/>
<xsd:element ref="description" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" use="required"
                                         type="xsd:string"/>
<xsd:attribute name="return_type" use="required"
                                         type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="argument">
<xsd:complexType>
<xsd:attribute name="type" use="required"
                                         type="xsd:string"/>
<xsd:attribute name="label" use="required"
                                         type="xsd:string"/>
<xsd:attribute name="mode" use="required" type="modeType"/>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="modeType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="input_only"/>
<xsd:enumeration value="output_only"/>
<xsd:enumeration value="input_output"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="presentation">
<xsd:complexType>
<xsd:attribute name="group" use="required"
                                         type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="description" type="xsd:string"/>
</xsd:schema>

Element and Attribute Reference for Stored Procedure Description File

Table  8-1 lists and describes the elements and attributes of the Stored Procedure Description file.

Table 8-1 Stored Procedure Description file XML elements and descriptions

Element

Attribute

Description

<definitions>
targetNameSpace

The namespace declared for the stored procedures.

<types>

Declares any primitive or complex data types used in the stored procedure.

<functions>

Contains the function definitions for all of the stored procedures represented in this file.

<function>

Function definition for a single stored procedure.

name

Name of the stored procedure as defined in the database. If the stored procedure is part of a package, the name is the fully qualified name of the stored procedure (for example, packagename.sp_name).

If you are using procedure groups in Sybase or Microsoft SQL Server, see Rules for Procedure Names Containing a Semi-Colon.

return_type

Return type of the stored procedure. The type is defined in the <types> element of this file. Note that this type differs from the type which the stored procedure returns. If you are hand-crafting your own XQueries, you must perform a function signature transformation; for details, see Rules for Transforming the Function Signature When Hand Writing an XQuery.

<argument>

Contains the argument declarations for the inputs and/or outputs of the stored procedure.

label

The name of the argument input or output. This name is used in queries and is displayed in clients such as the Data View Builder.

type

Type of the argument. The type can be one of the types listed in Supported Datatypes, or it can be a complex type declared in the Stored Procedure Description file.

mode

Lists whether the argument is part of the input, output, or both. Possible values are:

  • input_only

  • output_only

  • input_output

<presentation group>

Currently not supported.

<description>

Comment text describing the stored procedures used in the Stored Procedure Description file.

Note: An element within the types definition with a name specified with name="return_value" is reserved to specify the return value from a function or a procedure. For an example, see Example 2: Type Definition with Simple Return Value.

Supported Datatypes

The stored procedures you define in the Stored Procedure Description files must use the XML data types shown in Table  8-2. You must map the database data types to one of the types in this table. For datatype support by database, see Stored Procedure Support by Database.

Except for user-defined complex data types, the types are all primitive data types.

Table 8-2 XML data types and their Java equivalents for Stored Procedure Description files

XML Data Type

Equivalent Java Data Type

xs:boolean
java.lang.boolean
xs:byte
java.lang.byte
xs:short
java.lang.short
xs:integer
java.lang.Integer
xs:int
java.lang.Integer
xs:long
java.lang.Long
xs:float
java.lang.float
xs:double
java.lang.double
xs:decimal
java.math.BigDecimal
xs:string
java.lang.String
xs:dateTime
java.util.Date

Complex Element Type

org.w3c.dom.Element

For JDBC and database-specific type mapping, see Supported Data Types.

 

Back to Top Previous Next