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: Determining a PK for a view

Re: Determining a PK for a view

From: Frank <franjoe_at_frisurf.no>
Date: Tue, 5 Jun 2001 23:23:10 +0200
Message-ID: <N5cT6.6794$lM3.133810@news1.oke.nextra.no>

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

Original text of this message

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