How to parse an PL/SQL type to XML format in ORACLE8

I've got a PL/SQL type ( table/records/...) and I want to set it to XML format :
I've got
TYPE return_row IS record (
value_1 NUMBER(2),
value_2 VARCHAR2(30));
TYPE return_test IS TABLE OF return_row
INDEX BY BINARY_INTEGER;
VARCHAR2 XMLformat;
And I want to set into XMLformat the value of return_test parsed to XML.

I only
need to know how to change a inputstream (instance of
an online xml file) to a Node. If your want to create a Node, maybe you're thinking DOM (as apposed to SAX) and you should take a look at the API for:
- DocumentBuilderFactory
- DocumentBuilder
and the
Document parse(...)
method family. They all return a Document, which is a type of Node.

Similar Messages

  • DBMS_SQL.PARSE with PL/SQL types

    Hi
    I need to use DBMS_SQL.PARSE with PL/SQL types defined in a package.
    I tried with a type record in a declare ..begin..end  script but I got an error ..(on second parameter):
    DBMS_SQL.PARSE(cursor_name, XXXXX, DBMS_SQL.NATIVE);
    It's possible?
    WIth SQL types defined at schema level it's works (es. Objects types) .
    If it's not possible, how can I resolve?
    Stefano

    Again, please post what XXXXX is. In order to use package declared types:
    SQL> create or replace
      2    package pkg1
      3      is
      4        type emp_rec
      5          is record (
      6                     empno number,
      7                     ename varchar2(10)
      8                    );
      9        type emp_rec_tbl
    10          is
    11            table of emp_rec
    12            index by pls_integer;
    13        g_emp_rec_tbl pkg1.emp_rec_tbl;
    14  end;
    15  /
    Package created.
    SQL> declare
      2      v_cur integer;
      3      v_sql varchar2(1000);
      4  begin
      5      v_cur := dbms_sql.open_cursor(2);
      6      v_sql := 'begin
      7                    select  empno,
      8                            ename
      9                      bulk  collect
    10                       into  pkg1.g_emp_rec_tbl
    11                       from  emp
    12                       where job = ''CLERK'';
    13                end;';
    14      dbms_sql.parse(
    15                     v_cur,
    16                     v_sql,
    17                      dbms_sql.native
    18                     );
    19  end;
    20  /
    PL/SQL procedure successfully completed.
    SQL>
    SY.

  • Can we generate the output of SQL Query in XML format ..

    Hi Team,
    Can we generate an XML doc for an SQL Query.
    I've seen in SQL Server 2000.It is generating the output of an SQL Query in xml format.
    select * from emp for xml auto
    The output looks like
    <emp EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="20"/><emp EMPNO="7370" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="10"/>

    Just a little bit of short hand.
    Get the XML out of your database, via HTTP
    Of course the easiest method is just to return an XMLType from a stored procedure and let the calling routine figure out what to do with it. Instead
    of that way though, I'll show you how to do it via HTTP. It's all completely built into 10g and is super easy to use.
    CREATE OR REPLACE VIEW emps_and_depts AS
    SELECT e.employee_id AS "EmployeeId",
    e.last_name AS "Name",
    e.job_id AS "Job",
    e.manager_id AS "Manager",
    e.hire_date AS "HireDate",
    e.salary AS "Salary",
    e.commission_pct AS "Commission",
    XMLFOREST (
    d.department_id AS "DeptNo",
    d.department_name AS "DeptName",
    d.location_id AS "Location"
    ) AS "Dept"
    FROM employees e, departments d
    WHERE e.department_id = d.department_id
    Some people hear web and immediately start salivating about security issues. Let me address that quickly. Just because you have the HTTP and/or
    FTP servers running in the database, that does not mean you have a security problem. For one, I would hope your databases are behind a firewall.
    Second, with the correct architecture (DMZ, app servers, etc) you can make this data available outside the firewall fairly transparently and third,
    just because it's on the web does not mean the data MUST be available on the internet. This is a good way to make your data available on your
    intranet. If you are worried about people INSIDE your firewall, that still doesn't preclude web based access. Follow Oracle security guidelines.
    Before I show you how to get to your data, let's talk about URLs and URIs. A URL is a Uniform Resource Locater and URI is a Uniform Resource
    Identifier. A URL is the way you would identify a document on the net, i.e. http://www.oracle.com is a URL. A URI is a more generic form of a URL.
    Oracle supports three types of URI: HTTPURIType - basically a URL (which would be like the URL above), XDURIType - a pointer to an XDB resource
    (usually an XML document but can be other objects), and DBURIType - a pointer to database objects.
    It's the DBURIType that we're going to concentrate on here. The DBURIType let's us reference database objects using a file/folder paradigm. The
    format for a DBURI is /oradb/<schema>/<table>. Oradb is shorthand for the database; it is not the database name or SID. My database is named XE
    but I still use oradb in the DBURI. For example, the view we created above is in my XE database, is owned by HR (at least in my case) and is called
    EMPS_AND_DEPTS. This can be referenced as /oradb/HR/EMPS_AND_DEPTS.
    If the view had many rows and you wanted only one of them, you can restrict it by including a predicate. The documentation for XDB has a great
    write up on Using DBURIs.In our case, we are going to write out the entire document. Now that you understand that the DBURI is a pointer to
    objects in our instance, we can use that to access the data as a URL.
    The format for the URL call is http://<machinename>:<port>/<DBURI>
    In my case, my XE database is running on a machine called mach1 and is listening on port 8080. So to see the view we created above, I open my
    browser and navigate to: http//mach1:8080/oradb/HR/EMPS_AND_DEPTS
    The created URL will be as http//mach1:8080/oradb/PUBLIC/EMPS_AND_DEPTS
    If your database is set up correctly and listening on port 8080 (the default), your browser should ask you to login. Login as the user who created the
    view (in my case HR). You should now get an XML document displayed in your browser.
    And that's it. It doesn't get much simpler than that. If you get rid of the descriptive text above, it basically comes down to:
    Create a table or view
    Open your web browser
    Enter a URL
    Enter a user ID and password
    View your XML
    If you notice, Oracle formatted the data as XML for us. Our view returns scalar columns and an XML fragment called Dept. Oracle formatted the
    return results into an XML format.
    And as a side note, if you look closely, you'll see that my URL has PUBLIC where I said to put HR. PUBLIC is a synonym for all objects that your
    logged in user can see. That way, if your user has been granted select access on many schemas, you can use PUBLIC and see any of them.

  • Display sql output in xml format

    Hi,
    We are using Oracle 9i. I want to display output of a sql query as xml format.
    I noticed EXTRACT function in SQL does this. Can anyone please explain XMLType instance and XPath string parameters of this function.
    All of my table columns are NUMBER/VARCHAR2 data types and the table is also NOT a XML Type. Please let me know the solution.
    Thanks.

    SQL> select dbms_xmlquery.getxml('select * from scott.emp where rownum < 3') from dual ;
    DBMS_XMLQUERY.GETXML('SELECT*FROMSCOTT.EMPWHEREROWNUM<3')
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <EMPNO>7369</EMPNO>
          <ENAME>SMITH</ENAME>
          <JOB>CLERK</JOB>
          <MGR>7902</MGR>
          <HIREDATE>12/17/1980 0:0:0</HIREDATE>
          <SAL>800</SAL>
          <DEPTNO>20</DEPTNO>
       </ROW>
       <ROW num="2">
          <EMPNO>7499</EMPNO>
          <ENAME>ALLEN</ENAME>
          <JOB>SALESMAN</JOB>
          <MGR>7698</MGR>
          <HIREDATE>2/20/1981 0:0:0</HIREDATE>
          <SAL>1600</SAL>
          <COMM>304</COMM>
          <DEPTNO>30</DEPTNO>
       </ROW>
    </ROWSET>
    1 row selected.
    SQL> select XMLType(dbms_xmlquery.getxml('select * from scott.emp where rownum < 3')).extract('/ROWSET/ROW[@num = "2"]/ENAME/text()').getStringVal() from dual ;
    XMLTYPE(DBMS_XMLQUERY.GETXML('SELECT*FROMSCOTT.EMPWHEREROWNUM<3')).EXTRACT('/ROWSET/ROW[@NUM="2"]/ENAME/TEXT()').GETSTRINGVAL()
    ALLEN
    1 row selected.
    SQL>

  • (262119469) Q DBC-17 How is data mapped from SQL-type to Java-type?

    Q<DBC-17> Is there any documentaion for the data mapping between the "java type" and
    the "sql type"
    A<DBC-17> The data types are the standard JDBC mappings. Check the javadoc for the
    java.sql package.

    Hi,
              If you are seeing last 3 fields coming as empty.... then you need to check the seperator type which correctly seperats one fields from another during mapping to BW infoobject.
    Thanks
    Kishore Kusupati

  • How to: SELECT statement returns the result in XML format.

    That's it... I want to execute a query that returns all rowset in XML format. How can I do it?
    Using Oracle 8.0 and up.
    Tnx.

    FOR XML is a proprietary Microsoft Hack... It is not supported by Oracle in any release. Oracle 9.2.x includes the SQLXML operators, which are part of the SQL:2003 standard and are the agreed upon (Mircosoft, IBM, Oracle etc) way of generating XML from relational data....
    See http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#sthref251

  • How to automate conversion of PDF forms to XML format

    Hi
    I have created a form using adobe livecycle designer 8. It has a email submit button that will send the form as a pdf file to a server.
    Once the server recevive this pdf file, they will store the pdf file into a local drive. How do I convert the pdf files in the local drive into XML format without actually opening the pdf file in the Adobe Professional and clicking export data as XML?
    Is there a way to write a code to convert these pdf files to XML format automatically?
    Hope someone can help me with this issue
    Regards
    Delvin Khong

    Hi Andersson,
    The request command is a form server command? Where do i type the Request.Form("page.form.field"). I dont really understand your statement on "Use request on the receiving page to get data" Could you help me by explaining more?
    Thank a lot for your advice
    Warmest Regards
    Delvin Khong

  • How can I generate Payment Instruction Register in XML format?

    Hi,
    I am going to customize the report "Payment Instruction Register". First of all, I have to get its data result in XML format. does anyone know how can to do that? Thanks a lot.
    24Billy

    Hi
    Select report and click on view select output format as DATA you will get dta in xml format.If data is not there in drop down list,go to layout by clicking on edit report then select u r template check the output format as DATA also.

  • How do i save a JTextPane's content XML-formated?

    I want to save a JTextPane's content XML-formated and also want to read the content from a stored XML-file back.
    Does anybody know a solution?
    Thanks in advance for your help!

    You will need to write the XML output yourself and use either SAX or DOM and an XML parser ( such as xerces from Apache ) to read the XML file back in.

  • How to speicfy the Oracle SQL type VARCHAR2 in XI data type

    Hi Gurus,
    I am trying to execute an Oracle stored procedure from XI which has parameters of type VARCHAR2. How to specify these data types in data type in XI?
    I am getting the below message when I execute the stored procedure from XI with data types CHAR/VARCHAR.
    com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'TEST_PACKAGE.MAIN ' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'MAIN' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    Please let me know.
    Thanks
    Kalyan

    Hi kalyan,
    i am also facing a similar issue.  the oracle stored procedure has three parameters i.e, two input paramters and 1 output paramter.
    I am passing all the parameters in the target structure, but i still get the same error.
    i have use isInput = "true" for two of the input paramters and isOutput = "true" for my output paramter.  For the output parameter, I am sending it blank.
    Please suggest.
    Thanks.
    Krishnan

  • How to parse Double to Integer Type?

    Dear all,
    I have a question in Java programming. How to change the variable of Double type into Integer Type? Is there any class that I should import in the Program?
    thanks.

    Double d = new Double(2.0);
    Integer i = new Integer(d.intValue()));

  • How to parse date in yyyyMMddHH'.'mmss'00' format

    Hi all,
    In an applet I am creating, I receive a timestamp in the following format:
    yyyyMMddHH'.'mmss'00'
    As an example, the date string I receive is "2003011419.304600" which, when decoded, gives, Jan 14 19:30:46 2003.
    I need to convert this to the MM/dd/yyyy format for date and HH:mm:ss:SS for time, in order to display it in my applet.
    Here is the scheme I am using:
    String inputDateFormat = "yyyyMMddHH'.'mmss'00'";
    SimpleDateFormat dateFormatter = new SimpleDateFormat("MM/dd/yyyy");
    SimpleDateFormat timeFormatter = new SimpleDateFormat ( "HH:mm:ss:SS");
    SimpleDateFormat formatter = new SimpleDateFormat ( inputDateFormat );
    // Assume the tokens vector contains the correct string
    Date dateTime = formatter.parse ( ( String ) tokens.elementAt ( 0 ) );
    String date = dateFormatter.format ( dateTime );
    String time = timeFormatter.format ( dateTime );
    However, I am getting parse exception, Unparseable date error at the following line:
    Date dateTime = formatter.parse ( ( String ) tokens.elementAt ( 0 ) );
    Is this because the date format does not contain any delimiters (like space or period or slash)? I am kinda confused.
    Thanks,
    Alan

    What I am wondering is
    whether the date can be successfully parsed even if it
    is in the strange format as above.My guess at this point in time is that this is a bug. I did not find anything in the bug database that suggested that it is known.
    The following code demonstrates it.
    Please post it (or let me know so I can post it.)
    I am using build 1.4.0-b92, so if someone could try it on 1.4.1 it would be nice.
         String s;
         SimpleDateFormat f;
         java.util.Date d;
         // Works
         s = "2003011419.3046";
         f = new SimpleDateFormat("yyyyMMddHH.mmss");
         d = f.parse(s);
         System.out.println("date with no specials=" + d);
         // Works with 'a' at end
         s = "2003011419.3046a";
         f = new SimpleDateFormat("yyyyMMddHH.mmss'a'");
         d = f.parse(s);
         System.out.println("date with a at the end=" + d);
         // Works with '>' at end
         s = "2003011419.3046>";
         f = new SimpleDateFormat("yyyyMMddHH.mmss'>'");
         d = f.parse(s);
         System.out.println("date with > at the end=" + d);
         // Doesn't work with '0'(zero) at end
         s = "2003011419.30460";
         f = new SimpleDateFormat("yyyyMMddHH.mmss'0'");
         d = f.parse(s);
         System.out.println("date with digit at end at the end=" + d);

  • How can I edit an RH9 .hhc file (XML format) to include a portion of a RH8 TOC (HTML format)?

    I blend output from a third-part application (Sandcastle) into an existing RH8 project.  I do this by decompiling and importing the HTML, then editing the RH8 .hhc file to include the .hhc information from Sandcastle.
    This worked fine until RH9 (and now RH10), where the format of the .hhc changed to XML.  Can someone tell me how to approach this now?  Currently, I worked around this by creating a RH8 project with the imported HTML/hhc from Sandcastle, then upgraded that project to RH9.

    I decompile the CHM file produced by Sandcastle because Sandcastle output does not provide an index file (.hhc) that I can use to edit the main TOC in my RoboHelp project.
    The Sandcastle HTML output files that I import into Robohelp have very intricate nesting and hyperlinking, so autogenerating a TOC in RoboHelp does not produce the desired results. Decompiling is the only way I see to obtain an index file that Robohelp will recognize and add/edit to the existing TOC.
    This may be ignorance on my part, but I can't look at an HTML-based .hhc (RH8) and know how to edit it to be XML-based (RH9).
    See below for examples.
    (RH8 .hhc)
    <UL>
          <LI><OBJECT type="text/sitemap">
            <param name="Name" value="SecurityKeywordList Class">
            <param name="Local" value="html/A077D816.htm">
          </OBJECT></LI>
          <UL>
            <LI><OBJECT type="text/sitemap">
              <param name="Name" value="SecurityKeywordList Members">
              <param name="Local" value="html/11169289.htm">
            </OBJECT></LI>
          </UL>
          <UL>
            <LI><OBJECT type="text/sitemap">
              <param name="Name" value="SecurityKeywordList Methods ">
              <param name="Local" value="html/F3929639.htm">
            </OBJECT></LI>
            <UL>
              <LI><OBJECT type="text/sitemap">
                <param name="Name" value="Find Method ">
                <param name="Local" value="html/3EA4BB08.htm">
              </OBJECT></LI>
            </UL>
            <UL>
              <LI><OBJECT type="text/sitemap">
                <param name="Name" value="FindAll Method ">
                <param name="Local" value="html/B9BC3800.htm">
              </OBJECT></LI>
            </UL>
          </UL>
          <UL>
    (RH9 /hhc)
    <item name="KeysetList Class" link="Unity\html\CE1C2166.htm">
         <item name="KeysetList Members" link="Unity\html\B924C78B.htm">
         </item>
         <item name="KeysetList Methods" link="Unity\html\2296b028.htm">
          <item name="Find Method " link="Unity\html\15B259BE.htm">
          </item>
         </item>
         <item name="KeysetList Properties" link="Unity\html\e98d8b4e.htm">
         </item>
        </item>
        <item name="Keyword Class" link="Unity\html\AC081184.htm">
         <item name="Keyword Members" link="Unity\html\AF52F347.htm">
         </item>
         <item name="Keyword Methods" link="Unity\html\C9317DF2.htm">
          <item name="Clone Method " link="Unity\html\2B16250F.htm">
          </item>
          <item name="Equals Method " link="Unity\html\5AA411AE.htm">
           <item name="Equals Method (Object)" link="Unity\html\EE184CE3.htm">
           </item>
           <item name="Equals Method (Keyword)" link="Unity\html\D600E80A.htm">
           </item>
          </item>
          <item name="GetHashCode Method " link="Unity\html\9A9979B7.htm">
          </item>
         </item>
         <item name="Keyword Properties" link="Unity\html\5A9776D1.htm">
          <item name="AlphaNumericValue Property " link="Unity\html\3CA3F3CF.htm">
          </item>
          <item name="CurrencyFormat Property " link="Unity\html\66CFE652.htm">
          </item>
          <item name="CurrencyValue Property " link="Unity\html\C2A5A2F6.htm">
          </item>
          <item name="DateTimeValue Property " link="Unity\html\B7358EF1.htm">
          </item>
          <item name="FloatingPointValue Property " link="Unity\html\6EA77C25.htm">
          </item>
          <item name="IsBlank Property " link="Unity\html\32367245.htm">
          </item>
          <item name="KeywordType Property " link="Unity\html\976D4B82.htm">
          </item>
          <item name="Numeric20Value Property " link="Unity\html\5A9DF184.htm">
          </item>
          <item name="Numeric9Value Property " link="Unity\html\56FE0652.htm">
          </item>
          <item name="Value Property " link="Unity\html\25A1DCBB.htm">
          </item>
         </item>
        </item>

  • Group SQL data in XML Format

    Hi All,
    I have t-sql result set (Shown in image). I want to convert it into xml data format (like the code under Edit this code section).
    There can be any number of clients and any number of projects. Can some one please help me out on this.

    declare @t table
    client varchar(100),
    project varchar(100),
    amt varchar(100)
    insert @t
    values('client1','project1',100),
    ('client1','project2',200),
    ('client2','project1',150),
    ('client2','project2',250),
    ('client3','project1',300),
    ('client3','project2',400)
    SELECT client as [li],
    (SELECT
    project AS [li],
    amt AS [li/u1/li]
    FROM @t
    WHERE client = t.client
    FOR XML PATH('ul'),TYPE)as [li/*]
    FROM
    SELECT DISTINCT client
    FROM @t)t
    FOR XML PATH('ul')
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to upload a smartform which is in .xml format

    hi,
    i have downloaded the smartform into .xml file. Now i need to upload it into a new smartform . how do i do it.

    Hi,
    Goto T-code smartforms , there Utilities --->  upload form
    It will ask for the form name give your Z form name then it will ask for the XML file specify the file . THE FORM IS CREATED.
    Regards,
    Vinod.
    Assign points if the answer is useful

Maybe you are looking for