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

Reply via email to