XQuery Update implementation

Hello,
is it possible to get prerelease of the next version of DBXML or at least the documentation focused on XQuery Update implementation.
Thanks
Mario

Mario,
2.4 will be generally available quite soon. The Getting Started Guides in the documentation have sections on basic XQuery Update usage (replacing the old sections on XmlModify). The candidate recommendation is a detailed (if not user-friendly) source of information:
http://www.w3.org/TR/xquery-update-10/
Regards,
George

Similar Messages

  • XML DML XQuery Update syntax

    Hi everybody,
    Certainly my question will appear strange and even stupid , but I want to be sure to use the best syntax and also to be confirmed about some points.
    In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?
    Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
    I think copy is not specific to Oracle, is it used in XQuery language ?
    In page 15, the SQL statement to modify XML document uses deletexml, not a XQuery update syntax.
    I'm using Oracle 11G.
    Thanks in advance for your explanations

    user4423142 wrote:
    In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?The recommended way is closely tied to the version you're using, which you didn't give.
    "11g" is not a version, it's a product name.
    You can find the version by running :
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    XQuery Update on Oracle in available in the latest version only : 11.2.0.3.
    If you're using this version, Oracle recommends you start using XQuery Update.
    Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
    I think copy is not specific to Oracle, is it used in XQuery language ?<tt>copy</tt> is specific to the XQuery Update Facility (XQUF) extension of the XQuery 1.0 language.
    The XQUF was primarily intended to work with native XML databases where it's OK to directly invoke update primitives (insert, delete, replace etc.) to modify database content.
    On Oracle, it's not possible and the current implementation only supports XQUF through the "transform" operation (copy/modify syntax) where a copy of the original document/fragment is modified and written back to the db.
    However, XQuery rewrite and related optimizations may occur so that piecewise updates actually take place.

  • XQuery Update Facility

    I see on the Wikipedia article for XQuery Update Facility, that XQilla, which BDBXML uses, implements the XQUF (not sure to which degree though). Can you utilize these commands in any XQuery, and does it require a special use of the API? Any documentation on your site? This looks like a very exciting language extension to have available.
    thank you,
    Brett

    Brett,
    Thanks. This also means XmlModify will eventually disappear since it's no longer
    necessary (and now implemented in terms of XQuery Update anyway). It's still around for
    now.
    As for security, we're considering one or both of:
    1. bool XmlQueryExpression::isUpdateExpression() to allow the application
    to ask the question and decide.
    2. A flag (e.g. DBXML_NO_UPDATES) passed to the relevant execute() and query() functions. In Java it'd be a new configuration option in XmlDocumentConfig
    Do you have a preference? I'm leaning toward (1) -- it's a slightly simpler change
    and just as easy to use.
    Regards,
    George

  • XQuery update

    Hello,
    I seems that the CVS version of XQuilla implements a large part of the XQuery Update working draft, which is great !
    Does it mean that it's usable with BDB XML as-is to get database updates ?
    Thanks,
    Fabrice

    Hi Fabrice,
    I'm afraid there is significant work to do in DB XML before XQuery Update can be used from it. However, It is our intention to support XQuery Update in some future version.
    John

  • XQuery Update Facility in XMLDB?

    Hi
    I didn't find information about XQuery Update Facility
    support or XUpdate support in Oracle XML DB. Do you have
    such info?
    Regards,
    --drkm                                                                                                                                                                                                                                                                                                                           

    Xquery update is NOT anywhere near well enougth defined for us to implement it at present. We are actively involved in the standards process for XQuery update. It's very unclear what the future of the XUpdate is at this point...
    We support node-level updates through a set of SQL functions
    updateXML (9iR2 and later), insertChildXML, appendChildXML, insertXMLBefore and deleteXML (10gr2 and later)
    Message was edited by:
    mdrake

  • Xml Validation & XQuery Update

    Hello,
    I have a question on xml validation in Berkeley DB XML (2.5.16).
    I read in documentation that an xml can be validated against an xml DTD or Schema when is loaded into a container. However, when an XQuery Update is to be executed is there any configuration that allows checking if the XQuery Update leads to an xml that does not conform with the DTD/Schema? If so, how this case is managed? The XQuery is executed, or not? Is there any exception thrown?
    I made a test over this: I wrote an xml (and a related DTD) where an element contains an id attribute and another element a referencing attribute to the aforementioned id. Then, an XQuery Update 'delete' expression deletes the element with the id attribute. The element is indeed deleted, the xml is left in an inconsistent state and I am allowed of making more update operations to this document...
    I was wondering if there is any way of handling this case, except from being careful with what updates you choose, so that the xml is kept in a valid state. Is there something I am missing?
    thank you in advance,
    theo

    Hello,
    I believe that XQuery execution does not support DTD yet. I'll investigate further and let you know what else I can find.
    Thanks,
    Sandra

  • Use of XQuery Update Facility

    Dear all,
    I am looking for some database systems that use the W3C XQuery Update facility specification to modify their data.
    To the best of my knowledge, no of well-known commercial database systems uses XQuery Update primitives.
    For instance, Oracle 11g defines some SQL/XML update functions (combined with some XQuery expressions) to modify XML data stored within the database through the XMLType data type.
    IBM DB2 9 uses SQL update statement to modify the whole XML document stored as an XML column and no update is proposed to modify parts of the document.
    Are there some database systems providing XQuery-Update-Facility-based update of their data.
    Thank you in advance.
    Best regards.

    Were you aware of
    [url http://www.liberidu.com/blog/2011/09/22/oracle-xmldb-xquery-update-in-database-release-11-2-0-3-0/]Oracle XMLDB XQuery Update in Database Release 11.2.0.3.0
    Given it is new, expect a few bugs, such as
    {thread:id=2355054}
    If you have specific questions related to XQuery Update, the best place to ask them is over in the {forum:id=34} forum.

  • Xquery update transaction (xqilla)

    Hi,
    it seems that when performing an xquery update such as 'insert node' that a transaction is allocated for this query, so that (using the Java API) there is no need to explicitly create a transaction - is this true?
    If it is, then just using xquery gets rid of a transaction management problem and the try/finally.
    thanks,
    Norman

    An updating query is auto-transacted if a transaction is not provided. However, auto-transacted methods still need to catch deadlock exceptions and retry.
    John

  • Decreasing performance when executing consecutive XQuery Update operations

    hello,
    I am writing an application in java using Berkeley DB XML (2.5.16). I have to run a test over the application, in which a lot of XQuery Update operations have to be executed. All update operations are insert statements. In the beginning the test works fine. However, as the number of updates increases (over 1000 XQuery Updates), there is also a great increase in time of execution. How can I enhance the performance of updates?
    Note that:
    1) The environment configuration is the following:
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(true);
    envConfig.setInitializeCache(true);
    envConfig.setCacheSize(512*1024*1024);
    envConfig.setInitializeLocking(false);
    envConfig.setInitializeLogging(false);
    envConfig.setTransactional(false);
    2) No transactions are used
    3) The container is a node container
    4) Auto-indexing is on (I need that)
    5) The container includes only one xml of 2,5MB size.
    6) In some insert statements 1000 nodes are to be inserted.
    7) I am running windows vista on a 4GB Ram pc.
    Thank you in advance,
    theo

    Hi Lucas,
    Thanks a lot for your reply! However, I have a few more questions.
    Given that the xml is about 2.5MB size, is it considered to be that big for Berkeley DB so it needs to be break down into smaller documents?
    Also, after having executed ~4000 xquery update insert operations and doubled xml’s size, the performance it’s really getting worse… An insertion may even take 1.5 min, when for each of the first 3000 insertions only less than 0.5 sec is needed… Is there something I am missing in the configuration of Berkeley DB? If I set autoindexing off and try to maintain fewer indexes, is it possible to see significantly better performance? Till now I am just getting the following error when I set my indexes and try to execute consequent insertions over the same node:
    Exception in thread "main" com.sleepycat.dbxml.XmlException: Error: Sequence does not match type item() - the sequence does not contain items [err:XUDY0027], <query>:1:1, errcode = QUERY_EVALUATION_ERROR+
    at com.sleepycat.dbxml.dbxml_javaJNI.XmlQueryExpression_execute__SWIG_1(Native Method)
    at com.sleepycat.dbxml.XmlQueryExpression.execute(XmlQueryExpression.java:85)
    +<myClasses>+
    Thanks,
    theo

  • XQuery Update (11.2.0.3) and the path table

    Hi,
    I'm currently using XQuery update on 11.2.0.3 to merge 2 XML documents, having tried a number of approaches up to now on 11.2.0.2.
    My table has one XMLType column (securefile binary containing unstructured xml) which has XML deltas applied to it via a stored procedure.
    An unstructured XML index is defined on the column.
    Previously, I was doing the following:
    1) Merge documents using XMLQuery; only produce a merged document if changes were detected
    2) Update the table if the merged document is non-null
    i.e.
    select XMLQuery(<merging code>) passing oldDoc as "oldDoc", delta as "delta" returning content) into mergedDoc from dual;
    if (mergedDoc is not null) then
        update myTable set xmlDoc = mergedDoc where id=v_id;
    end if;However, this replaces the entire document if any changes are detected (with an obvious impact on the path table).
    I then read (UpdateXML query rewrite with unstructured data? about the use of XQuery Update in 11.2.0.3 to only target the affected document fragments so my current approach is:
    update myTable
    set xmldoc =
            xmlquery('declare namespace m="http://www.blah.com/merge";
            (: See if two nodes have matching text (or no text which is an empty sequence :)
            declare function m:matchText($one as element(), $two as element()) as xs:boolean {
                if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
            declare updating function m:merge($old as element()?, $new as element()?) {
                (for $o in $old/* return
                    for $n in $new/* where name($o) = name($n) return
                        if (count($n/*) > 0) then
                            m:merge($o, $n)
                        else
                            if (m:matchText($n, $o)) then () else replace value of node $o with $n,
                    for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
            copy $d := .
            modify (
                (m:merge($d/*,$delta/*))
            ) return $d'
            passing xmldoc, delta as "delta"
            returning content)
    where id = v_id;If no changes were detected between the documents (i.e. the XQuery update did not actually modify the document), would you expect this statement to have no impact on the path table? Is there any way to get more trace information which shows what the update is actually doing when it executes?
    Apologies if this is overlong or if I have omitted any supplementary information.
    Thanks for any assistance
    Larry

    Hi,
    many thanks for your reply.
    A simple testcase is below. The recursive approach is required because the documents may be hierarchial.
    create table mytable (id number(19,0), xmldoc xmltype) xmltype column "XMLDOC" store as securefile binary xml;
    insert into myTable values (1,xmltype('<xml><el1>1</el1><el2>2</el2><el3>3</el3></xml>'));
    update myTable
    set xmldoc =
            xmlquery('declare namespace m="http://www.blah.com/merge";
            (: See if two nodes have matching text (or no text which is an empty sequence :)
            declare function m:matchText($one as element(), $two as element()) as xs:boolean {
                if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
            declare updating function m:merge($old as element()?, $new as element()?) {
                (for $o in $old/* return
                    for $n in $new/* where name($o) = name($n) return
                        if (count($n/*) > 0) then
                            m:merge($o, $n)
                        else
                            if (m:matchText($n, $o)) then () else replace value of node $o with $n,
                    for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
            copy $d := .
            modify (
                (m:merge($d/*,$delta/*))
            ) return $d'
            passing xmldoc, xmltype('<xml><el1>1-UPDATE</el1><el4>4</el4></xml>') as "delta"
            returning content)
    where id = 1;This results in one update and one insert:
    <xml><el1>1-UPDATE</el1><el2>2</el2><el3>3</el3><el4>4</el4></xml>It currently produces the following trace:
    *** 2012-03-13 10:13:34.708
    not delete/insert/replace in modify clause
    --------- XQuery NO rewrt expr END-----
    --------- XQuery NO rewrt expr BEG-----
    UDF with noderef
    --------- XQuery NO rewrt expr END-----I've noticed that even with a simple XQuery update like the following:
    update myTable set xmldoc =
            xmlquery('copy $d := .
            modify (
                (replace value of node $d/xml/el1 with "1-UPDATE-2",insert node <el4>4</el4> into $d/xml)
            ) return $d'
            passing xmldoc
            returning content) where id = 1;I get the following trace:
    *** 2012-03-13 10:31:42.280
    --------- XQuery NO rewrt expr BEG-----
    non-simple content in target expression
    --------- XQuery NO rewrt expr END-----
    --------- XQuery NO rewrt expr BEG-----
    not delete/insert/replace in modify clause
    --------- XQuery NO rewrt expr END-----
    Non-iterator usage
    Non-iterator usageDoes this also indicate that a rewrite is not occurring, or is this only when a message like "NO REWRITE Reason ==> xseq:not optuop" is traced?
    I'll try XSLT in the meantime.
    Regards
    Larry

  • How are JDBC batch updates implemented by Oracle?

    When you're looking to reduce commits you typically think of JDBC batch updates.
    I'm just wondering how are these implemented by Oracle and is there ever gains to be had to reducing commits in an Oracle specific way like say using VARRAYs with procedures?

    Please refer
    http://www.oracle.com/technology/products/oracle9i/daily/jun07.html

  • WSUS / Software Updates implementation

    Hi - I have a problem with my Software Update / WSUS environment.  I have WSUS and Software updates on the same server its a Windows 2012 server running SCCM 2012,
    If I set Software updates to Sync from MS and WSUS to SYNC from SCCM it does not get any updates.
    If I set WSUS to Sync from MS and SCCM from WSUS - updates come through fine.
    However - when i check WSUS the following day WSUS has auto reset to sync from SCCM, so I end up with WSUS getting updates from SCCM and SCCM from WSUS - ie neither get any new updates.
    Happy for SCCM to go off and get the updates but need to figure out why it doesnt get the updates but WSUS does.
    Any help and advise appreciated

    If I set Software updates to Sync from MS and WSUS to SYNC from SCCM it does not get any updates.
    If I set WSUS to Sync from MS and SCCM from WSUS - updates come through fine.
    When you are implementing a patching solution via ConfigMgr/WSUS you do not configure WSUS at all. ConfigMgr does that for you.
    Have a look at this - this is how you do it.
    http://www.gerryhampsoncm.blogspot.ie/2013/04/sccm-2012-sp1-step-by-step-guide-part.html
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • Sample Php Class update() implementation

    Hey guys,
    I've spent 2 days straight trying to figure out how to implement the update function in the sample class that Flash builder generates. Testing the operation works fine, but when i try to implement it in code using:
    protected function updateProduct(item:Product):void
    updateProductResult.token = productService.updateProduct(item);
    it simply refuses to work. I know i am missing something completely obvious but i just can't figure it out!!! Thanks in advance guys.
    - T

    Sorry for forgetting to reply to this post as resolved. Yes Data Management was enabled, and after disabling it, it worked! Thanks for the reply, you've been of more help then some other people in the forums. Might I ask why the data management option screws up nonquery functions? Thanks again!

  • [SOLVED] intel-ucode update - implementation?

    There is a new intel-ucode package in testing and it will be released soon - this is going to require some intervention to get the microcode update on boot.  Is there going to be some advice for adding in the additional initrd lines for different bootloaders/bootmanagers?
    For example if I understand correctly for rEFInd it will need an amendment to the refind_linux.conf or perhaps if you have menuentry stanzas then additional initrd sections can be added in the refind.conf?
    Does anyone know if there is a recommended way to do this for rEFInd, and for other bootloaders that are in common use?
    Last edited by mcloaked (2014-10-23 15:32:06)

    I have just updated my system to the new kernel and new microcode packages (linux 3.17.1-1 intel-ucode 20140913-1).  This system boots with rEFInd.  The /boot/refind_linux.conf file was edited to include the microcode image file as an initrd= entry with lines as
    # cat /boot/refind_linux.conf
    "Boot to X" "root=PARTUUID=b0c9c220-0f8d-49c1-b306-873d2519ce47 rw rootfstype=ext4 add_efi_memmapinitrd=/boot/intel-ucode.img initrd=/boot/initramfs-linux.img systemd.unit=graphical.target"
    "Boot to console" "root=PARTUUID=b0c9c220-0f8d-49c1-b306-873d2519ce47 rw rootfstype=ext4 add_efi_memmap initrd=/boot/intel-ucode.img initrd=/boot/initramfs-linux.img systemd.unit=multi-user.target"
    "Boot Fallback to console" "root=PARTUUID=b0c9c220-0f8d-49c1-b306-873d2519ce47 rw rootfstype=ext4 add_efi_memmap initrd=/boot/intel-ucode.img initrd=/boot/initramfs-linux-fallback.img systemd.unit=multi-user.target"
    The system boots in the same time as previously with kernel 3.16 and the journal log confirms early microcode update.
    # journalctl -b | grep microcode
    Oct 23 15:41:56 localhost kernel: CPU0 microcode updated early to revision 0x1b, date = 2014-05-29
    Oct 23 15:41:56 localhost kernel: CPU1 microcode updated early to revision 0x1b, date = 2014-05-29
    Oct 23 15:41:56 localhost kernel: microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x1b
    Oct 23 15:41:56 localhost kernel: microcode: CPU1 sig=0x306a9, pf=0x2, revision=0x1b
    Oct 23 15:41:56 localhost kernel: microcode: CPU2 sig=0x306a9, pf=0x2, revision=0x1b
    Oct 23 15:41:56 localhost kernel: microcode: CPU3 sig=0x306a9, pf=0x2, revision=0x1b
    Oct 23 15:41:56 localhost kernel: microcode: Microcode Update Driver: v2.00 <[email protected]>, Peter Oruba
    So the updated kernel works fine for early microcode update, with the small amendment to the refind_linux.conf file as the rEFInd author suggested it would. I have tested this on three different machines all of which use rEFInd to boot. It is presumed that the latest microcode for the CPU in this machine is dated correctly as 2014-05-29.
    Last edited by mcloaked (2014-10-23 14:50:48)

  • PutDocument and XQuery update in the same txn

    Hey all!
    Is it a good idea to use putDocument() and then insert nodes into another document in the same transaction? The only thread I have hangs on XmlQueryExpression qe = xmlManager->prepare(...). If it's not a good idea, can I somehow perform those two actions atomically?
    Many thanks
    Vyacheslav

    Hi Vyacheslav,
    That's completely fine. My suspicion is that you aren't using the transaction for the call to XmlManager::prepare(), which is then creating a new transaction under the covers. Using more than one transaction in a single thread is a really bad idea, and can lead to the kind of hangs you describe.
    John

Maybe you are looking for

  • I get a "Short DST" failed error when running test. Laptop will not boot up. Any ideas?

    I get a Short DST failed error when I ran a test.  The laptop won't bootup. All I get is a black screen

  • Problem with my Ipod from Iphone

    Two days ago, i put in my Iphone some video files, all was good, i could see all files, all perfectly, but yesterday i dont know how, but i cant see no one of them, i know there are there all files because, the space of that video file are there, i d

  • Editing in photoshop, then returning to lightroom

    I apologize if this has been asked before, but I've been searching for a while now and haven't found an answer. If I select the 'edit in photoshop' option in lighroom, the images opens up in photoshop as expected.  If I then save the image in PS, it

  • Illustrator cs6 wish list?!?!

    hello forumers. i bumped into a post about flash cs6 and adobe has created a wish list gaining propositions about its next suite.so is there a wish list for illustrator c6???? this link is for the wish list for flash users just to get an idea http://

  • HT1766 Restart the app download after a pause in the restore process.

    I need to restart the "restore" function on my replacement iPhone after leaving the apple store before all downloads were complete. How do I reactivate the restore after I paused it when I went off wifi? Tapping individual app icons does not work.