Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Determining a PK for a view
Hi!
Could it be that you are asking:
"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?"
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, another approach to determine the columns is
to look in dba_col_constraints/dba_constraints to find possibly PK or UNIQUE
constraints.
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.
CREATE VIEW x AS (
SELECT y key_business_name,
COUNT(f) some_business_name
FROM z
GROUP BY y
)
Frank Received on Tue Jun 05 2001 - 16:23:10 CDT
![]() |
![]() |