Re: Question about system tables
Date: Wed, 24 Nov 1993 14:10:47 GMT
Message-ID: <CH021z.Ay6_at_trc.amoco.com>
In article g6o_at_urmel.informatik.rwth-aachen.de, meskes_at_ulysses.informatik.rwth-aachen.de (Michael Meskes) writes:
-->I'm just trying to run a little application using ORACLE to store some data.
-->I just want to do a single access to some of the system tables just to know
-->how many columns are in a table, but I do not find a system table with that
-->information. Is there one? I know that I can get this information in another
-->way, e.g.
-->
-->select COLUMN_ID from ACCESSIBLE_COLUMNS A where TABLE_NAME = 'TEST' and
-->not exists (select * from ACCESSIBLE_COLUMNS B where TABLE_NAME = 'TEST'
-->and A.COLUMN_ID < B.COLUMN_ID);
-->
-->But a simple select would be faster.
What about
select tname,count(*)
from col
group by tname
/
This gives for example : (edited output as there a lot of system tables)
TNAME COUNT(*) ------------------------------ ---------- FORM_BLK_ 17 FORM_COMMENT 9 FORM_COMMENT_ 9 FORM_FLD 45 FORM_FLD_ 45 FORM_MAP 6 FORM_MAP_ 6 FORM_PAGE 17 FORM_PAGE_ 17 FORM_PROCEDURE 4 FORM_PROCEDURE_ 4
Therefore you need to do the following
select tname,count(*)
where tname='FRED'
group by tname
--- ------------------------------------------------------------------------------ David Crowson =%^) |"For my part, I travel not to go anywhere, but to go. Oracle DBA(Ver.4,5,6,7)| I travel for travel's sake. The great affair is to Amoco Exploration | move, to get down off this featherbed of civilisation Ealing, London | and to find the globe granite underneath and strewn "My views not Amoex's" | with cutting flints" : Robert Louis StevensonReceived on Wed Nov 24 1993 - 15:10:47 CET