Thanks for your quick reply. Note that this is not a major feature that I would need since it is easy to do it at the application level. I was just wondering if this would have been possible not only to generate sequence number but for other things as well. I guest that's what triggers are for. But there are no trigger for the "SELECT", only for INSERT, DELETE and REPLACE. If there would be a trigger on SELECT then it would be possible to get a sequence number. But I am not a database expert so a trigger on SELECT may not make any sense for Sedna. Tks, Jocelyn Raymond
________________________________ From: Ivan Shcheklein [mailto:[email protected]] Sent: August 12, 2010 2:11 PM To: sedna-discussion Cc: Raymond, Jocelyn Subject: Re: [Sedna-discussion] UPDATE inside a function Hi Jocelyn, No, it's not possible. You have to generate unique sequence on application level. We'll think of adding this in our TODO list. Ivan Shcheklein, Sedna Team On Thu, Aug 12, 2010 at 9:01 PM, Raymond, Jocelyn wrote: Hi Sedna Team, Is it possible to execute a UPDATE replace inside a function? Something like: module namespace uid = "https://registrar.ualberta.ca/functions"; declare function uid:get-unique-id() as xs:decimal { let $val := document('unique-sequence')/id let $id := $val + 1 {UPDATE replace $v in document('unique-sequence')/id with <id>{$id}</id>} return $id; } I am simply trying to create a function that will generate a unique id similar to a Sequence in Oracle. Thank you, Jocelyn Raymond ------------------------------------------------------------------------ ------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Sedna-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sedna-discussion
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ Sedna-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sedna-discussion
