Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger to ensure unique objects

Re: Trigger to ensure unique objects

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 21 Jan 2004 15:15:26 -0800
Message-ID: <1074726855.718058@yasure>


Christian "Raistlin" Gulich wrote:

> 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

http://tahiti.oracle.com

Just use the UNIQUE keyword when buiding a FBI.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed Jan 21 2004 - 17:15:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US