Click Introspect. Design Time

9-110 Oracle Fusion Middleware Users Guide for Technology Adapters restriction simpleType element element name=RATING db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=4 restriction simpleType element element name=VIEWER_RATING db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=5 restriction simpleType element element name=STATUS db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=11 restriction simpleType element element name=TOTAL_GROSS type=decimal db:type=NUMBER minOccurs=0 nillable=true element name=DELETED db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=5 restriction simpleType element element name=SEQUENCENO type=decimal db:type=NUMBER minOccurs=0 nillable=true element name=LAST_UPDATED type=dateTime db:type=DATE minOccurs=0 nillable=true element name=POLLING_STRATEGY db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=30 restriction simpleType element sequence complexType element sequence complexType complexType name=SYS.MOVIESOBJ sequence element name=TITLE db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=30 Oracle JCA Adapter for Database 9-111 restriction simpleType element element name=DIRECTOR db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=30 restriction simpleType element element name=STARRING db:type=VARCHAR2 minOccurs=0 nillable=true simpleType restriction base=string maxLength value=30 restriction simpleType element sequence complexType schema Proceed to step 5. b. If no rows are returned, the Introspection Failed dialog is displayed, as shown in Figure 9–52 . Figure 9–52 Introspection Failed Dialog The Adapter Configuration Wizard generates a weakly typed XSD and displays it in the XSD text field by default, overwriting any edits you may have made to a previous version of the XSD. Go back to step 3 and enter test argument values that will return a row set with at least 1 row. c. If the stored procedure or function throws an exception, the Introspection Error dialog is displayed, as shown in Figure 9–53 . 9-112 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 9–53 Introspection Error Dialog The Adapter Configuration Wizard generates a weakly typed XSD and displays it in the XSD text field by default, overwriting any edits you may have made to a previous version of the XSD. Go back to step 3 and enter test argument values that will return a row set with at least 1 row.

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

shown in the XSD text filed. 6. Proceed to step 10 in Section 9.7.1.1, Using Top-Level Standalone APIs . 9.7.7.1.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; END; END; After using the Adapter Configuration Wizard to define a strongly typed XSD, after the procedure executes, the following XML is generated for parameter, C: C C_Row DEPTNO10DEPTNO DNAMEACCOUNTINGDNAME C_Row C_Row DEPTNO11DEPTNO DNAMEDEVELOPMENTDNAME C_Row … C Oracle JCA Adapter for Database 9-113 Using the Oracle Database Adapter, at run time, it does not matter if the XSD describing the strongly typed ref cursor is inline or imported. The strongly typed XSD is applied by the SOA runtime and is visible in the Oracle Enterprise Manager Console, where appropriate. For example, Figure 9–54 shows the audit trail for an invoke that returns a ref cursor payload using a strongly typed XSD. Figure 9–54 Audit Trail for Stongly Typed Payload

9.7.7.2 Row Set Support Using a Weakly Typed XSD

Currently a REF CURSOR by nature can support any arbitrary result set, so the XSD generated at design time is weakly typed. By default, the Adapter Configuration Wizard generates a weakly typed XSD for a REF CURSOR. However the XML output from this is hard to use. It is very difficult to write an Xpath expression or XSL based on a weakly typed XSD and column names as attribute values instead of element names. Although a row set can represent any result set, it is possible to assume for some procedures that it will have the same structure each time, and hence can be described with a strongly typed XSD. A strongly typed XSD is almost a necessity if you want to transform the result set to another XSD later on. If a strongly typed XSD is better suited to your use case, see Section 9.7.7.1, Row Set Support Using a Strongly Typed XSD . This section includes the following topics: ■ Section 9.7.7.2.1, Design Time ■ Section 9.7.7.2.2, Run Time 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;