Thank you, Ivan.

My user's note is - full update functionality is needed much. Luckily I can do things as you advised easily with Cocoon, but still.

Thanks for index advice.


Andrei Lunjov



23.09.2010 10:00, Ivan Shcheklein ?????:
Hi Andrey,


    declare variable $x external;
    for $a in $x/root/a
    let $id := $a/id
    return
        if( exist( collection('aaa')/a[ id = $id ] ) )
        then(
            update insert
    <m>...</m>
            into collection('aaa')/a[ id = $id ]
        )
        else (
            update insert
    <a>
    <id>...</id>
    <m>...</m>
    </a>
            into collection('ettevotja_muudatused')
        )

    else statement clearly doesn't work, cause I need to specify a
    document
    name and create is somehow.
    How can I do this inside such a statement?



Sedna doesn't support nested insert statements (http://modis.ispras.ru/sedna/progguide/ProgGuidesu6.html#x12-430002.3). If you need complex mass update you have to implement it on the application level: just start transaction and break your query into multiple XQuery and XUpdate statements.

BTW, consider creating value index on collection('aaa')/a by id (see http://modis.ispras.ru/sedna/progguide/ProgGuidesu8.html#x14-480002.5.3 and http://modis.ispras.ru/sedna/progguide/ProgGuidesu5.html#x9-310002.2.2).

    And common question - does Sedna have any plans for XQuery Update
    Facility http://www.w3.org/TR/xquery-update-10 to implement?



Yes, but we can't say exact timeline for this feature.


Ivan Shcheklein,
Sedna Team

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to