12 Replies Latest reply: Apr 2, 2011 10:42 AM by mdrake-Oracle RSS

    about oracle xe

    567684
      dose oracle xe support xquery? and oracle database standard edition?
      i want to use oracle xe query xmltype data,what should i do?
        • 1. Re: about oracle xe
          mdrake-Oracle
          XQuery is available for SE but not XE. This is due to the fact the XE does not include support for Java in the DB and in 10.2.0.1.0, which is XE is based on we use Java to PARSE the XQuery expression. In SE and EE 10.2.0.3.0 the java XQuery parser is replaced with 'C' XQuery parser so if XE is ever patched to 10.2.0.3.0 or later XQuery support would be possbile.
          • 2. Re: about oracle xe
            Pollocks01
            I recently noticed that xmlsequence, extract and extractvalue SQL functions are deprecated in 11gR2. I used these in Oracle XE because XMLTABLE is not supported (due to this JRE limitation)......

            In place of xmlsequence, extract and extractvalue we're to use XMLTABLE, XMLCAST and XMLQUERY. Does this mean that when the 11g based version of XE comes out, then there'll be no way to do xml sequence type operations, because as I understand it, XMLQUERY can't be used to return a sequence, and instead XMLTABLE must be used.......

            Also, another reason to not want to use XMLQUERY is that I found it crashed with a Java Exception on 10gR2 when parsing large (100Mb) XML files. Maybe this has been overcome by the C implementation that you (@MDRAKE) cite?

            Please advise.

            Thanks!
            • 3. Re: about oracle xe
              Marco Gralike
              Hopefully there will be a 11.2 XE version this year. Its "C" based since 10.2.0.3, IOW it is not in 10gXE (=10.2.0.1).

              Can't imagine that XQuery can not return a sequence, though, I am not a XQuery wizard but XQuery is much more powerful than the old XSQL functions.
              • 4. Re: about oracle xe
                Pollocks01
                As I understand it, the XQuery language itself can return any node or fragment. What I was trying to say is that the XQuery function doesn't appear to be able to return COLUMN representations of the Xquery output: you have to have to use the XMLTABLE (not supported in current version of XE) or XMLSEQUENCE (deprecated in 11gR2) in order to query XML like a table.

                If you can provide an example where we can do a select col1, col2...from {an XML string} where something=whatever, then I'd love to see it!
                with xml as
                (
                SELECT XMLQuery('/rowset/row'
                                PASSING xmltype.createxml('<rowset>
                                                             <row><col1>Hello</col1><col2>World</col2></row>                          
                                                             <row><col1>Hello</col1><col2>Again</col2></row>
                                                           </rowset> 
                                                           ')
                                RETURNING CONTENT) as xml
                  FROM dual)
                select xmlcast(xmlquery('$x/row/col1' passing xml as "x" returning content) as varchar2(30)) as col1,
                       xmlcast(xmlquery('$x/row/col2' passing xml as "x" returning content) as varchar2(30)) as col2
                from xml; 
                
                COL1            COL2
                ----            ----
                HelloHello      WorldAgain
                
                hmm, not what I wanted.
                
                I wanted:
                
                COL1            COL2
                ----            ----
                Hello           World
                Hello           Again
                Thanks....

                Edited by: user6246156 on Mar 23, 2011 8:53 AM
                • 5. Re: about oracle xe
                  odie_63
                  Hi,
                  What I was trying to say is that the XQuery function doesn't appear to be able to return COLUMN representations of the Xquery output: you have to have to use the XMLTABLE (not supported in current version of XE) or XMLSEQUENCE (deprecated in 11gR2) in order to query XML like a table.
                  So, you're concerned about XMLTable availability in XE11?
                  I'm not working for Oracle but I can't imagine any of the SQL/XML functions missing in the next XE version.
                  • 6. Re: about oracle xe
                    Pollocks01
                    odie_63 wrote:
                    Hi,
                    What I was trying to say is that the XQuery function doesn't appear to be able to return COLUMN representations of the Xquery output: you have to have to use the XMLTABLE (not supported in current version of XE) or XMLSEQUENCE (deprecated in 11gR2) in order to query XML like a table.
                    So, you're concerned about XMLTable availability in XE11?
                    I'm not working for Oracle but I can't imagine any of the SQL/XML functions missing in the next XE version.
                    That's right - I made an observation that XMLTable doesn't work in XE(10) and that the XE(10) alternative (XMLSEQUENCE) has been deprecated in 11gR2 so was hoping that XE(11) would support XMLTable. XMLSEQUENCE does still work in 11gR2 but - as a deprecated feature - is a candidate to 'disappear' in any future release.

                    Let's wait and see what they give us in XE(11) ;-)
                    • 7. Re: about oracle xe
                      811001
                      Perhaps relevant - I asked sth. similar here some time ago:

                      XQuery
                      • 8. Re: about oracle xe
                        Pollocks01
                        republic wrote:
                        Perhaps relevant - I asked sth. similar here some time ago:

                        XQuery
                        MDRAKE's comment puts me at ease: thanks for pointing this out. It's a great explanation of what 'deprecated' actually means.

                        Another piece of great functionality that I regularly use but which has been deprecated in 11gR2 is the xmltype.getBlobVal method - this is the ONLY way that I've found to be able to efficiently auto-add the xml prolog without hardcoding the characterset:

                        e.g. v_blob := v_xml.getBlobVal(nls_charset_id('CHAR_CS'));

                        as opposed to having to do something like this:

                        select xmlserialize(document v_xml_msg as blob encoding 'UTF-8' version '1.0') into v_xml_blob from dual; <-- you actually have to hardcode the characterset.

                        I think I'm therefore comfortable using deprecated features where the alternatives are either unavailable (in the case of using XMLSEQUENCE in XE) or inflexible (e.g. xmltype.getBlobVal).

                        Thanks!
                        • 9. Re: about oracle xe
                          Marco Gralike
                          Its almost there 11.2 beta download

                          http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html

                          Documentation – http://www.oracle.com/pls/xe112/portal.all_books
                          Feature availability – http://download.oracle.com/docs/cd/E17781_01/license.112/e18068/toc.htm#BABJBGGA
                          Licensing Restrictions – http://download.oracle.com/docs/cd/E17781_01/install.112/e18803/toc.htm#BABIECJA
                          • 10. Re: about oracle xe
                            Pollocks01
                            Marco Gralike wrote:
                            Its almost there 11.2 beta download

                            http://www.oracle.com/technetwork/database/express-edition/11gxe-beta-download-302519.html

                            Documentation – http://www.oracle.com/pls/xe112/portal.all_books
                            Feature availability – http://download.oracle.com/docs/cd/E17781_01/license.112/e18068/toc.htm#BABJBGGA
                            Licensing Restrictions – http://download.oracle.com/docs/cd/E17781_01/install.112/e18803/toc.htm#BABIECJA
                            Yes, I was excited to find out today that XE 11 beta is out - I hope to install this some time soon and try out the XML support!

                            Thanks
                            • 11. Re: about oracle xe
                              Marco Gralike
                              It says in the beat docs

                              Feature availability
                              -------------------------------------------------------------------
                              XML support in the database - Yes (no JNDI, or Servlet support)

                              Wondering about the "no Servlet support" but time will tell soon enough...
                              • 12. Re: about oracle xe
                                mdrake-Oracle
                                No JVM = no java servlets, which are the only kind of servlets you can write. The standard XDB servlets (oradb, webservices, EPG) will be present.