Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger to ensure unique objects
Hi,
I understand the problem. Could you give me a hint, what a "unique
function-based index" is or where I could read more about it? It would be
very helpfull.
Thanks, Christian
"Karsten Schmidt" <groups_at_karsten-schmidt.com> schrieb im Newsbeitrag
news:c6711ac4.0401210020.5b749b6c_at_posting.google.com...
> Hi,
> your trigger will not be able to see uncommitted changes made by
> another session. No way around that. All you need to break uniqueness
> is two concurrent inserts. The only way to do this kind of thing
> within a trigger is to take an exclusive lock on the entire table,
> thus making insert/update a single-user operation.
>
> As Connor said, it is far better to use unique constraints. (i.e.
> allows concurrent modification.) You might be able to use a trigger to
> pull the 'unique' information out of the image and store it in a
> regular column with an unique constraint, or create a unique
> function-based index.
>
> Karsten
Received on Wed Jan 21 2004 - 05:12:42 CST
![]() |
![]() |