Question

i was wondering about a more specific insert placement in the Sedna xml database.

i do get the idea of the into, preceding and following expressions presented in the UPDATE insert documentation. into-inserts at a random place into the node. following- inserts it after the node. preceding- inserts it before the node.

however, how would i "UPDATE insert" into not at a random place but at the last position inside the node?

my most successful attempt so far is doing "insert after" ../some/node/path/[last()]- this is ok if the node contains something. however, in case there is no nodes it will, of course, not select any "last" node and won't insert at all. in that case i have to do extra query to check whether is the node empty or not -unfortunately this solution seems like a hack to me and i have to use one extra select query.

is there a way to achieve this behavior that i want? and in general, is there any rule about does the "insert" statement insert the node into a random position?

Was it helpful?

Solution

Unfortunately, the way you described is only one for now. You can add feature request there: http://sourceforge.net/p/sedna/feature-requests

"INTO" doesn't guarantee any particular position.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top