Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2006, 06:47 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSQL ref_cursor

Hi,

I am having problems with an XSQL page that uses a ref_cursor as it is not displaying any results. This is my PL/SQL packaged function with the cursor:
Code:
CREATE OR REPLACE PACKAGE ref_cursor_loan_price IS
   TYPE loan_cursor_type IS REF CURSOR;
   FUNCTION return_cursor(price NUMBER,op VARCHAR2) RETURN loan_cursor_type;
END;
/
CREATE OR REPLACE PACKAGE BODY ref_cursor_loan_price IS   
   FUNCTION return_cursor(price NUMBER,op VARCHAR2) RETURN loan_cursor_type IS
      loan_price_cursor loan_cursor_type;
   BEGIN
     IF op='greater' THEN
      OPEN loan_price_cursor FOR 
       SELECT DISTINCT b.ISBN, b.title, b.description, b.author, b.publisher, b.pages   
       FROM loan l, book b, copy c, loan_type t
       WHERE t.type_id = l.type_id
        AND l.copy_id = c.copy_id
        AND c.ISBN = b.ISBN
        AND t.price > price;
     ELSE 
       OPEN loan_price_cursor FOR 
       SELECT DISTINCT b.ISBN, b.title, b.description, b.author, b.publisher, b.pages  
       FROM loan l, book b, copy c, loan_type t
       WHERE t.type_id = l.type_id
        AND l.copy_id = c.copy_id
        AND c.ISBN = b.ISBN
        AND t.price < price;
     END IF;
     RETURN loan_price_cursor;
    END;
END;
/
The XQSL page that returns the ref_cursor (b.xsql):
Code:
<?xml version="1.0"?>
<page connection="myconnection" xmlns:xsql="urn:oracle-xsql">
<ref-cursor>
 <xsql:ref-cursor-function>
  ref_cursor_loan_price.return_cursor(3.00,'greater')
 </xsql:ref-cursor-function>
</ref-cursor>
</page>
which returns this:
<?xml version="1.0" ?>
- <page>
- <ref-cursor>
  <ROWSET />
  </ref-cursor>
  </page>

I have run the sql query in SQL* Plus and it returns the data that I require.

Please can someone shine some light on the problem? Thank you for your time.





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSQL Query proddy XML 0 May 19th, 2007 04:34 PM
Setting up Tomcat with Oracle to do XSQL proddy Apache Tomcat 0 May 11th, 2007 02:57 PM
XSQL proddy XML 0 May 10th, 2007 12:03 PM
XSQL date and currency formatting c3008212 XSLT 0 March 18th, 2006 08:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.