Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Entering generated unique value.
On Mon, 05 Feb 2001 21:57:13 -0800, "Daniel A. Morgan" <dmorgan_at_exesolutions.com> wrote:
>From a functional stand point I do not understand what you are trying to do.
>But if you want a unique value for an index sequences are the answer. If you
>want unique values that are not numeric ... either apply TO_CHAR() or BITAND.
>
>Dan Morgan
I am trying to have an id for rows, where the id is not recognizable as having any meaning.
Imagine a session id on a website that let's you read email or has a shopping cart. If the session ids were in any way sequential, someone would be able to mess up someone else's session. Therefore the number has to be completely random.
In a similiar fasion, I need a completely unique id for each record, besides the usual sequence based id. I happen to have such a function, and have been using it for quite a while. I am just concerned that as the databse gets hit my more and more people, the time-lapse inbetween checking if an id is unique and entering it may allow for another process to add the exact same id causing the insert to fail.
Maybe this will help explain the process.
I am just looking for ideas on how to guarantee unique ids, or at least be able to handle the possible insert error.
Brian Received on Tue Feb 06 2001 - 07:41:26 CST