Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Determining a PK for a view
Richard Wheeldon wrote:
> Hi,
>
> I have a problem which I'm trying to find a solution for.
>
> If I have a view or table, I can usually index these
> by rowid. However, I can't index those which are constructed
> using 'distinct' or 'group by'. But each of these constructs
> must have a primary key (of sorts - i.e. a pk by date/codd's
> definition, if not defined as such in the dd), being those
> fields after the group by or distinct.
>
> e.g. with: create view x as (select y,count(f) from z group by y),
> y must be a primary key.
>
> So the question is, how can I find out which these columns
> are from the data dictionary, without having to parse
> the view definition?
>
> Richard
What just a minute. You can't index anything by rowid. Rowid is not indexable. So when you say "usually" I am thinking you've never done anything in Oracle before.
And the rest of your query makes little sense as it stands.
Why don't you state the end result you are trying to achieve and let those that know Oracle help you by suggesting a solution. I, for one, haven't a clue what you are attempting from the above.
Daniel A. Morgan Received on Tue Jun 05 2001 - 00:01:12 CDT