p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Database > Oracle ASP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 16th, 2008, 09:06 AM
Registered User
 
Join Date: Jan 2008
Location: Mumbai, Maharashtra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Oracle stored procedure with clob return

Hi All,

I have a req. to write a store proc. (in oracle) which will fire a query and store the output
in a clob variable (don't know weather it is possible or not) and that “Clob“would be return as output of the procedure. Actually I need an XML string as output of the procedure can it be possible? Any kind of Help would be highly appreciable.

Regards
Alok
__________________
Alok
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 31st, 2008, 07:53 AM
Registered User
 
Join Date: Jan 2008
Location: Mumbai, Maharashtra, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PROCEDURE sp_test_XML(plgcode IN VARCHAR2,result out clob) IS

    qryCtx DBMS_XMLGEN.ctxHandle;
    parent_id NUMBER;
    queryVal varchar2(20000);


BEGIN
            select id into parent_id from HRDW_ADMIN.BUDGET_CONTROL_DOLLAR where BUDGET_CONTROL_DOLLAR.PLG_CODE=plgcode;

                    queryVal:='SELECT * from HRDW_ADMIN.BUDGET_CONTROL_DOLLAR_AUDIT where PARENTID = '|| to_char(parent_id);

                    qryCtx := DBMS_XMLGEN.newContext (queryVal);

                    DBMS_XMLGEN.setRowTag(qryCtx, 'RECORDS');

                    result := DBMS_XMLGEN.getXML(qryCtx);

                    DBMS_XMLGEN.closeContext(qryCtx);

            EXCEPTION WHEN NO_DATA_FOUND THEN

                    queryVal:='SELECT ' || '''NA''' || ' as DATA from DUAL';

                    qryCtx := dbms_xmlgen.newContext (queryVal);

                    DBMS_XMLGEN.setRowTag(qryCtx, 'RECORDS');

                    result := DBMS_XMLGEN.getXML(qryCtx);

                    DBMS_XMLGEN.closeContext(qryCtx);
END sp_test_XML;

Alok
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedure return value dmiles C# 3 December 6th, 2007 05:20 AM
how can i return a recrdset in a stored procedure? arathy ASP.NET 1.0 and 1.1 Basics 0 December 12th, 2006 04:24 AM
Can i return a recordset in a Stored procedure chiefouko VB Databases Basics 6 December 12th, 2006 03:34 AM
how i use the Stored Procedure return value and ho yoord ADO.NET 5 June 28th, 2004 09:39 AM
Can i return a recordset in a Stored procedure chiefouko SQL Server 2000 1 June 23rd, 2003 07:13 AM



All times are GMT -4. The time now is 07:15 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc