How to access the xml stored procedure clob?

Hello
I am producing what appears to be a simple bit of code (just a simple report in the form of a web page), while what I've tried so far only does not work. I come back kind of clob broken by the stored procedure, so I feel it's almost right, but who knows at this point. TIA

Here is an excerpt from Oracle:

-p_XMLReport ON CLOB,
-qryCtx DBMS_XMLGEN.ctxHandle;
-sql_stmt VARCHAR2 (32767).

qryCtx: = DBMS_XMLGEN.newContext (sql_stmt);
p_XMLReport: = DBMS_XMLGEN.getXML (qryCtx);

Here's a snippet of VB:

Conn = New OracleConnection
Dim cmd As New OracleCommand
Dim rs As OracleDataReader
Try
Connection group conn cmd.
Conn. Open()
cmd.CommandText = "GETDATA".
cmd.CommandType = CommandType.StoredProcedure
cmd. Parameters.Add (New OracleParameter ("p_XMLReport", OracleDbType.Clob)). Direction = ParameterDirection.Output
cmd. Parameters.Add (New OracleParameter ("p_Conditions", OracleDbType.Clob)). Value = "'" + conditions + "'."
cmd. Parameters.Add (New OracleParameter ("p_Fields", OracleDbType.Clob)). Value = "'" + fields + "'."
RS = cmd. ExecuteReader()
xmlDoc = New XmlDocument
CLOB Dim As String
CLOB = (cmd. Parameters ("p_XMLReport"). (Value). Value ' kind of work...
Response.Write ("< pre >")
Response.Write (clob)

Usually you would call ExecuteReader only if you use a query or a proc that returns a ref cursor

See if that helps,
Greg

/*
create or replace procedure getxmlclob(v1 out clob) as
qryCtx DBMS_XMLGEN.ctxHandle;
sql_stmt VARCHAR2(32767);
begin
sql_stmt := 'select * from all_objects';
qryCtx := DBMS_XMLGEN.newContext (sql_stmt);
v1 := DBMS_XMLGEN.getXML(qryCtx);
end;
/
*/
using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

class Program
{
    static void Main(string[] args)
    {
        using (OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl"))
        {
            con.Open();
            using (OracleCommand cmd = new OracleCommand("", con))
            {
                cmd.CommandText = "getxmlclob";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("foo", OracleDbType.Clob, ParameterDirection.Output);
                cmd.ExecuteNonQuery();
                Console.WriteLine(((OracleClob)cmd.Parameters["foo"].Value).Value.ToString());
            }
        }
    }
}

Tags: Database

Similar Questions

  • How to read the XML stored in a clob value

    is it possible to store the date in variable, something like
    Select sysdate double dated;
    in this query.
     SELECT   XMLFOREST (sysdate as "date")  from dual;
    SQL> declare
       clob_val clob;
    begin
       select xmlforest (sysdate as "date", dummy as "order").getclobval ()
         into Clob_VAL
         from dual;
         dbms_output.put_line(xmltype('' || clob_val || '').extract('e/order/text()').getstringval());
    end;
    /
    X
    PL/SQL procedure successfully completed.
    
  • How to access the XML in Flex

    < user >

    < UID = "HR" dept >

    < user >

    mm < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < user >

    SSS < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < / dept >

    < UID = 'Finance' dept >

    < user >

    FFFF < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < user >

    www < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < / dept >

    < / users >

    using the HTTP service with access to the data

    This my user.xml file I want to display all the item in flex datagrid using the function navigator tab... each browser tab contains a grid of data for corresponding like HR, sales, Finance Dept

    the corresponding information will be displayed in the data grid

    first tab navigatore is

    HR-> grid of data such as fname, Email field

    Finance-> fname, E Mail

    Try this if you have problems and the way in which you want to change it:


    <>
    "xmlns:MX ="http://www.adobe.com/2006/mxml"
    Layout = "vertical".
    "" xmlns:local = "*".
    creationComplete = "init ()" > "


           
               
                    
                          mm
                          [email protected]
                    

                    
                          SSS
                          [email protected]
                    

               

               
                    
                          FFFF
                          [email protected]
                    

                    
                          www
                          [email protected]
                    

               

           

       

       
       
           
    dataProvider = "{myXML.dept}" > "
               

                   
                       
                           
                           
                       

                   

                       
           
       
       

    Kind regards

    Adrian

  • How to access the files from google docs?

    Hello

    can someone tell me how to access the mp3 files saved on google docs.

    as I am able to recover google docs docs files.

               connection = (HttpConnection) Connector.open("http://docs.google.com/feeds/documents/private/full/-/document");
                connection.setRequestMethod(HttpConnection.GET);
                connection.setRequestProperty("Authorization", auth);
                connection.setRequestProperty("Content-type","application/atom+xml");
    

    but the mp3 files do not appear in the xml only doc files are listed?

    any idea how to get mp3 files?

    Thankx

    @Sannyo: agree with you.

    I also saw that. This is only the docs.

    ------------------------------------------------------------------------------------
    Kudo press to say thank you to the developer.
    Also, press accept it as a button when you got the Solution.

  • Apex. Submit-&gt; process to run one of the two stored procedures on page

    version: 4.2.5

    page one region: form on the stored procedure

    region of page two: form on the stored procedure

    The region button 'submit' for the region page 2:

    ACTION: Redirect URL

    Run Validations: YES

    Target URL: javascript:apex.submit ('CALL_MY_PROC');

    'Treatments' execute the stored procedure

    Point process: submit now - after calculations and Validations

    Enforcement process: once a Page visit (by default)

    ...

    Conditions

    When you press the button:-no Condition button

    Condition type: request = Expression 1

    Expression 1: REQUEST = CALL_MY_PROC

    The expected behavior is to call the stored procedure in the region on two page without invoking the other stored procedure.  Separation of concerns is desired, this button sends the form this proc, this button argues that form to this proc.  Nor should call each other, so to speak.

    The stored procedure is not called when I click 'Submit' (button from region to region page two).  How can I solve this?

    Thanks in advance for any guidance.

    -abe

    Solution: the status... are not REQUEST =

    -abe

  • Re: "insufficient privileges" error when you run the Java stored procedure in another schema

    I get an "insufficient privileges" error when you run the Java stored procedure in another schema, see details below.  I don't know what are missing privileges (I already granted the EXECUTE privilege), suggestions?  -Thank you.

    Define a simple java class and deploy it as a Java stored procedure to test:


    Schema: User1

    test of the package;

    public class HelloWorld {}

    public HelloWorld() {

    Super();

    }

    public static String Hello () {}

    Return "HELLO";

    }

    }

    CREATE or REPLACE FUNCTION HELLO RETURN VARCHAR2 AUTHID CURRENT_USER AS LANGUAGE JAVA NAME ' test. HelloWorld.hello () return java.lang.String';

    Grant execute on USER2 HELLO

    Test the Java stored procedure through the PL/SQL function call (in the same schema):


    Schema: User1

    SET SERVEROUTPUT ON

    DECLARE

    v_Return VARCHAR2 (200);

    BEGIN

    v_Return: = User1. HELLO;

    DBMS_OUTPUT. Put_line ('v_Return =' | v_Return);

    END;

    anonymous block filled

    v_Return = HELLO

    Test the Java stored procedure through the PL/SQL function call in a different pattern:


    Schema: USER2

    SET SERVEROUTPUT ON

    DECLARE

    v_Return VARCHAR2 (200);

    BEGIN

    v_Return: = User1. HELLO;

    DBMS_OUTPUT. Put_line ('v_Return =' | v_Return);

    END;

    Error report-

    ORA-01031: insufficient privileges

    ORA-06512: at "User1." HELLO', line 1

    ORA-06512: at line 4 level

    01031 00000 - "insufficient privileges".

    * Cause: An attempt was made to change the user name or password

    without the privilege appropriate. This error also occurs if

    trying to install a database without the need for employment

    access privileges.

    When Trusted Oracle is configure in DBMS MAC, this error may occur

    If the user has been granted the privilege necessary for a higher label

    that the connection is active.

    * Action: Ask the database to perform the operation or grant administrator

    the required privileges.

    For users Trusted Oracle get this error, well that granted the

    the privilege that is suitable for the top label, ask the database

    administrator to grant the privilege to the appropriate label.

    You have created the function with AUTHID CURRENT_USER, which means that the function is executed with the rights of the applicant (but not with the rights of the author). This means that the applicant must have grants (directly or through roles) on all used/accessible objects in the service. In your case the user USER2 has not granted with EXECUTE on the class/source Java test. Class HelloWorld, causing the ORA-01031 exception. You create service without AUTHID CURRENT_USER (i.e. with AUTHID DEFINE, which is by default, if you do not have a specific reason to use AUTHID CURRENT_USER) or grant EXECUTE on JAVA test SOURCE. Class HelloWorld to User2.

    Dimitar

  • How to access the MDS of Hudson and Machine Unix resources?

    Hello
    How to access the MDS of Hudson and Machine Unix resources?

    I can do even Jdeveloper using the local filesystem n oramds Protocol and access resources.

    Please share the information for Hudson & Unix Machine?

    Kind regards
    En

    Need for resources MDS configure using adf - config.xml in the application. You can also change the configration of 'Oracle_SOA1\bin\ant-sca-package.xml '.

    Concerning

    En

  • SSL mutual authentication using the Oracle stored procedure

    Hello

    DB version:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Is possible to perform mutual authentication SSL uses the Oracle stored procedure?
    I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs). But I would like to know if it's possible and how.

    In other is words there a way to incorporate the client certificate information into a procedure that calls a Web service.

    I read the articles to do it in JAVA or .net. But please advice how we can achieve using Oracle procedures.

    Thank you.

    934451 wrote:

    Is possible to perform mutual authentication SSL uses the Oracle stored procedure?

    To learn more. SSL what for?

    Oracle PL/SQL only supports client standard TCP sockets. However, interface for HTTP, Oracle PL/SQL also supports HTTPS - which requires the certificates of authentication of the server to be stored in a portfolio of Oracle web and used during the transmission via HTTPS. See the code example {message identifier: = 1925297} for more details.

    I read articles and forums saying that it is not a good approach to call the Web service using the Oracle procedure (and I don't know if it's even possible authentication using procs).

    Forums and articles written by idiots. For idiots.

    And no, I'm not to embellish my response to this pitch that you met. It is false. It is written by ignorant people who don't know ANYTHING about the use of Oracle and PL/SQL. And feel free to forward my response to these idiots. They find me here if they want to argue...

    As an example of how to call a web service, see {message identifier: = 10158148} and {message: id = 10448611}.

  • To access the XML from a different class

    Hi all

    I have a xml class that loads the xml data, I need to access the data of another class. I imported the xml classinto the new class and created a new instance of it. However when I try to access the xml data it come back as null. I understand that it is certainly because when she is called the xml data has not completed loading. How can I get around this?

    XML class:

    package {}

    flash.xml import. *;
    import flash.events. *;
    import flash.net. *.
    import flash.display. *.

    public class xml extends MovieClip
    {
    public var xmlRequest:URLRequest;
    public var xmlLoader:URLLoader;
    public var xmlImages:XML;

    public void xml()
    {
    xmlRequest = new URLRequest ("images.xml");
    xmlLoader = new URLLoader (xmlRequest)

    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    xmlLoader.load (xmlRequest);
    }

    private void xmlLoaded(event:Event):void
    {
    trace (xmlLoader.Data);
    xmlImages = new XML (xmlLoader.data);
    }
    }
    }

    Thanks in advance

    Or even better:

    package {     import flash.events.*;     import flash.net.*;     import flash.xml.*;
    
         public class XMLLoader extends URLLoader     {          public var xmlImages:XML;
    
              public function XMLLoader()          {
    
              }
    
              public function loadXML(url:String):void {               this.addEventListener(Event.COMPLETE, xmlLoaded);               this.load(new URLRequest(url));          }
    
              private function xmlLoaded(event:Event):void          {               trace(xmlLoader.data);               xmlImages = newXML(this.data);               dispatchEvent(new Event("loadComplete"));          }     }}
    

    Use:

    var xmlLoader:XMLLoader = new XMLLoader();
    xmlLoader.addEventListener ("loadComplete", onXMLLoad);

    xmlLoader.loadXML ("images.xml");

    function onXMLLoad(e:Event):void {}
    trace (xmlLoader.xmlImages);
    }

  • Cannot access the XML file on localhost.

    Type localhost or 127.0.0.1 in any browser on a Macintosh (os 10.5) does not have access to the host computer.

    The following Actionscript code generates the following error:

    var XMLURL:URLRequest = new URLRequest ("http://localhost/quoteRotator/quotes1.xml");

    Error opening URL ' http://localhost/quoteRotator/quotes1.XML '

    #2044 error: Unhandled IO error...

    How can I access the XML file using Actionscript 3?

    Thanks for your help.

    use:

    var XMLURL:URLRequest = new URLRequest("quotes1.xml");
    
  • How to access the info in my iCloud account

    How to access the info in my iCloud account?

    You can access much of the iCloud.com on a computer or through specific applications on your mobile device such as contacts, calendars, iCloud Drive, Photos. What exactly you were looking for and what type of device.

  • How to access the bios?

    I am trying to install a new OS, how to access the bios on my HP Pavilian dv8?

    Hello:

    You should be able to access the BIOS by pressing the F10 key as soon as you see the HP welcome screen.

    Paul

  • How to access the BIOS on a Pavilion Elite e9237c with mouse and keyboard wireless?

    I have a desktop computer Pavilion Elite e9237 with a wireless keyboard and mouse. I tried to access the BIOS by pressing F10 at startup with no luck, and I can't access any of the other menus for the start-up eiither. I don't have a PS/2 port on my computer, so I can't get a wired keyboard and mouse. Does anyone know how to access the BIOS with this configuration?

    I bought a USB keyboard and he answered in the same way... No bios access. I then studied why it did not work and discovered that it was the way in which he has been connected to the computer. I had initially plugged into a USB hub when he was not working and I moved it directly into a USB port and it works! I plugged my keyboard wireless directly into the USB port and it works too! Thanks for your help... I wouldn't have thought of it if it wasn't for to recommend you the USB keyboard.

  • How to access the firefox on laptop Office keeping all the features?

    How to access the firefox on laptop Office keeping all tabs and bookmarks?

    Hello

    You may be able to do this in Firefox Sync configuration on both devices. Please see for detailed instructions.

  • Qosmio G30-126 - how to access the bios!

    I have a laptop Qosmio G30-126 and I don't know the key to enter the bios to change real estate for the HARD drive or something... then how to access the bios? What is the key for the bios?

    Hello

    Try pressing the F2 key by turning on the device.
    The Toshiba notebooks supported the ESC and then F1 button
    If these two options are possible

Maybe you are looking for

  • Help on Factory Reset

    Hello! IM new to this forum and I need help! I have a HP Pavilion dv7 1135nr and decided to restore it to the factory setting using the F11! I watched everything, but after that it says that your system has been restored to the factory and restarted

  • Cannot transfer emails

    multi-genre say in picasa for any recipiants live windows or not.  They are in the sent folder, however no one ever gets them.  The windows live account webmail version can convey the exact same emails.  My ISP is Roadrunner (tampabay.rr.com)

  • OfficeJet 6500 E709N series ~ can't print wireless...

    TRIED EVERYTHING ~ That is: we have a Mac running OSx 10.5.7 and PC with Windows XP and a laptop with windows XP. Our wireless router is a wireless 3 G of Lnksis. I bought the HPOJ 6500 e709n yesterday and adjusting upward all night.  Tried it on mac

  • How to partition HP drive media

    have pavillion d5000 with vista I need to partition the multimedia Pocket Player before using it, and how do I do it.

  • VMware FT has a problem starting secondary VM

    I could activate FT on a virtual machine that is shared over NFS meeting all the prerequisites of 1 Gbit/s NIC support. The ESX host on which I am allowing FT are also compatible such as confirmed by the analysis on Site. Logging of fault tolerance w