Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Finding KEY information from schema tables ?
In article <wdavies-1102981404110001_at_semantics.stanford.edu>,
Winton Davies <wdavies_at_cs.stanford.edu> wrote:
>Hi,
>
> How can I recover schema information (such as Primary Key's , COmposite
>Keys, Secondary Keys and so on?) from both Oracle and Sybase systems ?
>
> I've been looking at ODBC, and can see no function that does this. I'm
>assuming this information is stored in proprietary system tables, but a
>cursory look at a stack of documentation yield no leads....
>
In Sybase, you can get this information from the syskeys table. It can
be linked to the table by the 'id' column.
Many people don't define their primary and foreign keys. For primary keys, you can guess the key based on a unique clustered index on the table. This information can be found in the sysindexes table.
Paul
-- Paul Tomko | P.O. Box 1382 President | Bolingbrook, Illinois 60440 Tomko Consulting, Incorporated | (630) 759-8799 tomko@xnet.com | http://www.xnet.com/~tomkoReceived on Thu Feb 12 1998 - 00:00:00 CST