Re: SQL*Plus newbie questions
Date: 1996/01/23
Message-ID: <Pine.SUN.3.91.960123091328.19300C-100000_at_seatimes>#1/1
On 22 Jan 1996, Steve Chell wrote:
> 1. Once connected to the database via SQL*Plus, how do you list
> the tables. (Informix equivalent: info tables)
For your own tables: SELECT * FROM USER_TABLES; For all tables you have access: SELECT * FROM ALL_TABLES; And, if you are the DBA: SELECT * FROM DBA_TABLES;
> 2. Are there any system catalog tables which hold info about
> the tables, columns, etc in the database.
> (Informix equivalent: systables, syscolumns, etc)
Yes, see above for TABLES. COLUMNS: ALL, DBA, USER _TAB_COLUMNS CONSTRAINTS: ALL, DBA, USER _CONSTRAINTS etc. You will want to see appendix B in the SERVER ADMIN. GUIDE.
> 3. How do you determine the number of tables in the database.
> (Informix equivalent:
> select count(*) from systables where tabtype = "T")
Do you want ALL tables you have access to, your own tables, or (if you have DBA rights, everything in the database? Remember the ALL, DBA, and USER prefix? Use the appropriage one to: SELECT count(*) from xxx_TABLES;
> 4. How do you list the columns in a table.
> (Informix equivalent: info columns for tablename)
DESCRIBE tablename;
+----------------------------------------------------+ | Steve Butler Voice: 206-464-2998 | | The Seattle Times Fax: 206-382-8898 | | PO Box 70 Internet: sbut-is_at_seatimes.com | | Seattle, WA 98111 Packet: KG7JE_at_N6EQZ.WA | +----------------------------------------------------+All standard and non-standard disclaimers apply. All other sources are annonymous. Received on Tue Jan 23 1996 - 00:00:00 CET