Re: SQL*Plus newbie questions
Date: 1996/01/23
Message-ID: <4e2q7q$tii_at_cass.ma02.bull.com>#1/1
I can't believe Steve Chell <slc_at_stevensons.co.nz> wrote:
>Hi all. I come from an Informix background, and I'm currently
>trying to get to grips with Oracle, in particular SQL*Plus.
>Any help with the following would be appreciated.
>1. Once connected to the database via SQL*Plus, how do you list
> the tables. (Informix equivalent: info tables)
SELECT * FROM SYS.DBA_TABLES; (You may need DBA privileges to access this table.) You can replace "DBA" with "USER" to get just those which you have created; or with "ALL" to list those to which you have access.
>2. Are there any system catalog tables which hold info about
> the tables, columns, etc in the database.
> (Informix equivalent: systables, syscolumns, etc)
Best place to see these is in the back of the "Oracle7 Server SQL Language Quick Reference", a pocket-sized guide to the SQL language.
>3. How do you determine the number of tables in the database.
> (Informix equivalent:
> select count(*) from systables where tabtype = "T")
SELECT COUNT(*) FROM DBA_TABLES;
>4. How do you list the columns in a table.
> (Informix equivalent: info columns for tablename)
See DBA_TAB_COLUMNS.
Your questions highlight what I've discovered to be the weakest part of Oracle--access to the database metadata. I came to an Oracle shop from several years using DEC's Rdb, which had commands like
SHOW TABLE foo
SHOW TABLE (COLUMNS) *
etc.
Rumor has it (which I picked up at Oracle training this month) that the reasons Oracle bought Rdb from DEC was to get some of the Rdb optimizer and user interface code...
-- ~~~~~~~~~~~~~~~~|Words herein are mine, not my employer's. Jeffery Boes |"Einstein argued that there must be simplified explanations Database Analyst| of nature, because God is not capricious or arbitrary. No j.boes_at_zds.com | such faith comforts the software engineer." --Fred BrooksReceived on Tue Jan 23 1996 - 00:00:00 CET