Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Determining a PK for a view
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 Received on Wed Jun 06 2001 - 13:27:08 CDT