This discussion is archived
1 2 Previous Next 20 Replies Latest reply: Nov 14, 2012 3:38 AM by BluShadow RSS

Regarding XML datatype

974171 Newbie
Currently Being Moderated
Hi,

There is some XML data that is stored in the field of oracle XML dataype .

ex: oracle.sql.OPAQUE@4e1a77 how can i retrieve the actual data from the encapsulated XML datatype

TIA
  • 1. Re: Regarding XML datatype
    971895 Journeyer
    Currently Being Moderated
    Post data what is there in the table
  • 2. Re: Regarding XML datatype
    974171 Newbie
    Currently Being Moderated
    Field Name is ParamName

    Data Present in the field is oracle.sql.OPAQUE@4e1a77
  • 3. Re: Regarding XML datatype
    odie_63 Guru
    Currently Being Moderated
    There is some XML data that is stored in the field of oracle XML dataype .

    ex: oracle.sql.OPAQUE@4e1a77 how can i retrieve the actual data from the encapsulated XML datatype
    Funny.

    Apparently you're using Java. Maybe you should care telling us so?

    Are you the same user as in this thread : {thread:id=2463943} ?
    If so, you've already been directed to the FAQ, did you read it?
    And you know you don't have to register again, don't you?

    Anyway...

    "oracle.sql.OPAQUE@4e1a77" is the name of the XMLType class instance you probably obtained via the toString() method.
    Of course, that's not the actual data.

    You may want to use getStringVal() or getClobVal() methods instead, as they're implemented in Java too for the oracle.xdb.XMLType class.

    If you need more help, then give additional details, such as sample code, expected outcome etc.

    Edited by: odie_63 on 14 nov. 2012 11:54
  • 4. Re: Regarding XML datatype
    971895 Journeyer
    Currently Being Moderated
    that is not valid xml data.. always xml data contains tags as like <name>kk</name>
    i think you question in not matched
  • 5. Re: Regarding XML datatype
    974171 Newbie
    Currently Being Moderated
    Hello odie,

    I come to your way.

    Actually my requirement is there is some data encapsulated in the XML datatype column in the oracle11g version database.

    How will you retrieve that using the SQL script?

    TIA,
  • 6. Re: Regarding XML datatype
    974171 Newbie
    Currently Being Moderated
    Okay..

    This is the data encapsulated in the XML datatype like following example.

    Ex: Column Name : ParamValues
    Data is: 4e1a77

    Please help me to retrieve that using SQL script.


    TIA...,
  • 7. Re: Regarding XML datatype
    odie_63 Guru
    Currently Being Moderated
    Can't you apply the method suggested in your other thread?

    Post the table structure.
    Post the code you're currently using.

    And please be clear, do you want to get the whole content of the column, or do you need to present the XML data relationally so that you can insert it into another table?

    Edited by: odie_63 on 14 nov. 2012 12:05
  • 8. Re: Regarding XML datatype
    971895 Journeyer
    Currently Being Moderated
    how you are encapsulated data in table.. i think so encrypted and decrypted concept..
  • 9. Re: Regarding XML datatype
    Solomon Yakobson Guru
    Currently Being Moderated
    971168 wrote:
    How will you retrieve that using the SQL script?
    SQL> create table tbl(x xmltype)
      2  /
    
    Table created.
    
    SQL> insert
      2    into tbl
      3    values(
      4  '<Countries>
      5  <Country>England</Country>
      6  <Country>Spain</Country>
      7  <Country>Italy</Country>
      8  </Countries>')
      9  /
    
    1 row created.
    
    SQL> select  country
      2    from  tbl,
      3          xmltable(
      4                   '$x/Countries/Country'
      5                    passing x as "x"
      6                    columns
      7                      country varchar2(20) path '//text()'
      8                  ) t
      9  /
    
    COUNTRY
    --------------------
    England
    Spain
    Italy
    
    SQL> 
    SY.
  • 10. Re: Regarding XML datatype
    971895 Journeyer
    Currently Being Moderated
    you posted column name and data. what you are excepting ouput from the data
  • 11. Re: Regarding XML datatype
    BluShadow Guru Moderator
    Currently Being Moderated
    You were already asked not to duplicate your question:

    {thread:id=2463950}

    because you already had a thread asking it:

    {thread:id=2463943}

    So, you then sign up with another account on the forums to ask the same question again?

    Which part of NOT DUPLICATING your question are you failing to understand?

    If you continue to fail to post sufficient details as you have been directed several times ({message:id=9360002}), and continue to duplicate questions on the forum, your posts will be deleted and your account(s) will be reported to the site administrator to be terminated. Signing up with multiple accounts and duplicating questions IS NOT ACCEPTABLE and WILL be considered to be SPAMming the forums. Is THAT clear enough to you?
  • 12. Re: Regarding XML datatype
    974171 Newbie
    Currently Being Moderated
    COLUMN_NAME     DATA_TYPE      
    VISIBILITY_ACCESS      NUMBER      
    START_FROM     NUMBER     
    RPT_HEADER     VARCHAR2(512 Byte)     
    RPT     NUMBER     
    QRY_TITLE     VARCHAR2(256 Byte)     
    PARAM_VALUES     XMLTYPE     
    ORG     NUMBER     
    LASTUPDATE     DATE          
    ID     NUMBER     
    CREATEDATE     DATE
    AUTHOR     VARCHAR2(256 Byte)     


    Above is the table format
  • 13. Re: Regarding XML datatype
    BluShadow Guru Moderator
    Currently Being Moderated
    Solomon Yakobson wrote:
    971168 wrote:
    How will you retrieve that using the SQL script?
    SQL> create table tbl(x xmltype)
    2  /
    
    Table created.
    
    SQL> insert
    2    into tbl
    3    values(
    4  '<Countries>
    5  <Country>England</Country>
    6  <Country>Spain</Country>
    7  <Country>Italy</Country>
    8  </Countries>')
    9  /
    
    1 row created.
    
    SQL> select  country
    2    from  tbl,
    3          xmltable(
    4                   '$x/Countries/Country'
    5                    passing x as "x"
    6                    columns
    7                      country varchar2(20) path '//text()'
    8                  ) t
    9  /
    
    COUNTRY
    --------------------
    England
    Spain
    Italy
    
    SQL> 
    SY.
    Solomon, he's already been shown how to extract XML using XMLTABLE on his original question. He's just being a pain in the a*se and failing to follow forum etiquette or posting rules.
  • 14. Re: Regarding XML datatype
    odie_63 Guru
    Currently Being Moderated
    971168 wrote:
    Above is the table format
    OK, now what about some code?

    You're using Java, right?
    Post the code you're using to retrieve the column.

    What do you want to do next?
    Read again my previous questions, and answer them.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points