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: Karsten Schmidt <groups_at_karsten-schmidt.com>
Date: 20 Jan 2004 08:30:27 -0800
Message-ID: <c6711ac4.0401200830.10166e81@posting.google.com>


Hi,
 you better not implement that trigger at all. apart from being terribly slow, it is not going to work.
 imagine two people inserting the same logical row at about the same time.

Karsten

"Christian \"Raistlin\" Gulich" <Christian.Gulich_at_IN.Stud.TU-Ilmenau.de> wrote in message news:<buitr6$jk2$1_at_piggy.rz.tu-ilmenau.de>...
> Hi,
> I have some multimedia content in my database stored using interMedia.
> Because there is no way, to declare these objects (ORDImage, ORDVideo, ...)
> as unique (or is it possible?), I wanted to write a trigger, wich ensures
> this constraints.
> The trigger fires before insert and update operations for each row.
> In this trigger a have to check, if the same object is already in the table.
> Therefore I must read the complete table and perform my checks. The problem
> is, that this tricker throws an error, that "table is modified at the moment
> an the trigger can't see this". Oracle suggestion to solve this, is not to
> read this table in the trigger - not very good for me. I suppose there is a
> lock at the table. Do you have any suggestions, how I could implement the
> trigger?
> Thanks Christian
Received on Tue Jan 20 2004 - 10:30:27 CST

Original text of this message

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