Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle ASP
|
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 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 January 16th, 2008, 09:06 AM
Registered User
 
Join Date: Jan 2008
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
 
Old January 31st, 2008, 07:53 AM
Registered User
 
Join Date: Jan 2008
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





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 08:39 AM
Can i return a recordset in a Stored procedure chiefouko SQL Server 2000 1 June 23rd, 2003 06:13 AM





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