Re: Need Help With Query

From: jgar the jorrible <>
Date: Tue, 24 Feb 2009 17:26:42 -0800 (PST)
Message-ID: <>

On Feb 24, 4:40 pm, Pete <> wrote:
> Hi,
> I am new to Oracle and I was wondering if someone could help me with a
> query.  Basically, what I want to know is how to return all the
> columns in a given table EXCLUDING the primary key column.
> Thanks In Advance,
> Pete

desc user_tab_columns to see what you can know about columns. constraint_type='P' in user_constraints to see what the primary key is.

It is entirely possible to have tables with no primary key.

Google on those views (also there are ALL and DBA instead of USER, with increasing amounts of privilege) to find example scripts. user_tab_columns means those in the schema, all_tab_columns means those the user can see. Object names tend to be capitalized unless quoted. More information is in the doc set, searchable at


-- is bogus.
Received on Tue Feb 24 2009 - 19:26:42 CST

Original text of this message