Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: To know tables' columns in a database

Re: To know tables' columns in a database

From: Vince <vince_at_nospam.net.invalid>
Date: Fri, 20 Feb 2004 15:46:44 +0000
Message-ID: <40362be8$0$28445$636a15ce@news.free.fr>


I recall what I try to get:

For each key column, I would like to get a row with
- table name of this column

> You really need to get familiar with these views if you want to do > anything useful around Oracle in the long run.

Now, I have a select query which give me something as:

TABLE_NAME COLUMN_NAME CONSTRAINT_NAME TYPE

TABLE1      COL1         SYS_C00208068    Primary
TABLE1      COL2         SYS_C00208067    Foreign
etc

I try to make:

SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, TYPE, /* but also two new columns

1st) if type = 'Foreign' then take a value (not a string as 'xxxx') in a certain table
2nd) if type = 'Foreign' then take another value in a certain table

*/

FROM
( SELECT ... /* what give me the previous table */ ) <---- ALPHA

I try to use DECODE and CASE ...

In fact, the main problem is that I cannot use twice "type column" which   is extracted from the the ALPHA select. The error if a use twice same column is "SQL error: Il n'y a plus de données à lire dans le socket" <-> There is any data to read in socket.

Any idea? Thanks by advance. Received on Fri Feb 20 2004 - 09:46:44 CST

Original text of this message

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