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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Unique Index on a view

Re: Unique Index on a view

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Wed, 22 Nov 2000 19:48:51 GMT
Message-ID: <3a1c2309.155480203@news.alt.net>

On Wed, 22 Nov 2000 15:12:19 -0000, "Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote:

>
>There are a few ways I can think of to do
>this but none particularly efficient.
>
>The simplest is to create a control table with
>a matching primary key. As a pre-insert trigger
>insert a matching key into the control table.
>(And delete it with a pre-delete trigger, and generally
>fiddle about with an update trigger).
>
>As a variant, with a lot more code, but not
>leaving a filled control table use a pre-insert
>like:
> select row for update from other table
> if row exists, then raise error
> if row does not appear to exist then
> insert row into control tabl
> This may hang if another user is currently
> inserting the row in to the other table, and
> fail/succeed when the other users rollsback/commits
>then on a post-insert, you delete the control row.
>

Interesting idea.

Thanx,
Brian Received on Wed Nov 22 2000 - 13:48:51 CST

Original text of this message

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