Optionally, fine tune the strongly typed XSD by manually editing the schema

9-114 Oracle Fusion Middleware Users Guide for Technology Adapters For more information, see Section 9.3.3, Row Set Support Using a Strongly or Weakly Typed XSD .

9.7.7.2.1 Design Time

If the stored procedure or function you select contains an output parameter of type ResultSet, you can define a weakly typed XSD for this ref cursor as follows: 1. Using the Adapter Configuration Wizard, select a stored procedure or function that contains an output parameter of type ResultSet. See steps 1 through 8 in Section 9.7.1.1, Using Top-Level Standalone APIs .

2. Click Next. The RowSets page is displayed, as shown in

Figure 9–55 . By default, the Adapter Configuration Wizard generates a weakly typed XSD for this ref cursor shown in the XSD text field. Figure 9–55 RowSets Page

3. Optionally, fine tune the weakly typed XSD by manually editing the schema

shown in the XSD text filed. 4. Proceed to step 10 in Section 9.7.1.1, Using Top-Level Standalone APIs . 9.7.7.2.2 Run Time Suppose you have the following package: CREATE PACKAGE PKG AS TYPE REF_CURSOR IS REF CURSOR; PROCEDURE TESTC OUT REF_CURSOR; END; CREATE PACKAGE BODY PKG AS ROCEDURE TESTC OUT REF_CURSOR AS BEGIN OPEN C FOR SELECT DEPTNO, DNAME FROM DEPT; Oracle JCA Adapter for Database 9-115 END; END; The REF_CURSOR is a weakly typed cursor variable because the query is not specified. After the procedure executes, the following XML is generated for parameter, C: C Row Column name=DEPTNO sqltype=NUMBER10Column Column name=DNAME sqltype=VARCHAR2ACCOUNTINGColumn Row Row Column name=DEPTNO sqltype=NUMBER20Column Column name=DNAME sqltype=VARCHAR2RESEARCHColumn Row … C There is a total of four rows, each consisting of two columns, DEPTNO and DNAME. Ref cursors are represented by Java ResultSets. It is not possible to create a ResultSet programmatically by using APIs provided by the JDBC driver. Therefore, ref cursors may not be passed IN to a stored procedure. They can only be passed as INOUT and OUT parameters with one caveat. An INOUT ref cursor is treated strictly as an OUT parameter. Because no IN value can be provided for an INOUT parameter, a null is bound to that parameter when invoking the stored procedure.

9.7.7.3 Support for PLSQL Boolean, PLSQL Record, and PLSQL Table Types

The Adapter Configuration Wizard provides a mechanism that detects when these types are used and then invokes Oracle JPublisher to generate the necessary wrappers automatically. Oracle JPublisher generates two SQL files, one to create schema objects, and another to drop them. The SQL that creates the schema objects is automatically executed from within the Adapter Configuration Wizard to create the schema objects in the database schema before the XSD file is generated. For example, suppose the following package specification is declared: CREATE PACKAGE PKG AS TYPE REC IS RECORD X NUMBER, Y VARCHAR2 10; TYPE TBL IS TABLE OF NUMBER INDEX BY PLS_INTEGER; PROCEDURE PLSQL R REC, T TBL, B BOOLEAN; END; Figure 9–56 shows the step in the Adapter Configuration Wizard that is displayed when PROC procedure from PKG package is selected.