From: Richard Wheeldon <richard@rswheeldon.com>
Newsgroups: comp.databases.oracle.misc
Subject: Re: Determining a PK for a view
Date: Wed, 06 Jun 2001 19:27:08 +0100
Message-ID: <3B1E75FC.15FB@rswheeldon.com>
References: <3B1C2201.2781@rswheeldon.com> <N5cT6.6794$lM3.133810@news1.oke.nextra.no>
NNTP-Posting-Host: nova.rswheeldon.com
X-NNTP-Posting-Host: nova.rswheeldon.com:62.49.142.69
X-Trace: news.demon.co.uk 991852490 nnrp-01:5303 NO-IDENT nova.rswheeldon.com:62.49.142.69
X-Complaints-To: abuse@demon.net
X-Mailer: Mozilla 3.0Gold (X11; I; IRIX 6.2 IP22)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 30


Frank wrote:
> "How can I automatically determine which columns in a "table like" object is
> necessary to use in the WHERE
> clause to uniquely find one single row in the object?"

pretty much, yes. It seems the answer in general is there isn't a way :(

> If it is a table you intend to use ROWID; be aware that ROWID for a given
> row in a table may change during the lifetime of a table due to DBA's
> reorganization, DELETE/INSERT,

I was under the impression that insertions/deletions were unlikely to
affect the rowid of another entry under normal circumstances. When will
they
change? Change due to an explicit DBA reorganization can be tolerated.

> another approach to determine the columns is
> to look in dba_col_constraints/dba_constraints to find possibly PK or UNIQUE
> constraints.

True. But this breaks down under in other circumstances, notably if
these
constraints are not explicitely defined.

> For view I think it will be hard to automatically find the columns. Could
> you try to use a namingstandard on the columns in the views that you need?? eg.

Unfortunately, not.

Richard

