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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL statement to show all columns of a table

Re: SQL statement to show all columns of a table

From: Steve Bell <stephen.bell_at_sympatico.ca>
Date: Sun, 12 Aug 2001 07:39:55 -0400
Message-ID: <3B766B0B.BD2C9DA1@sympatico.ca>

Hi Karsten,

In SQL*Plus you can use the "describe" command. Usually people just use its short form, which is "desc". You simply type the word "desc" followed by the name of the table you want to see (e.g. "desc emp"). This is a SQL*Plus command so it doesn't require a terminator (semicolon) after it.

Here's an example to show all the columns in the DEPT table:

SQL> desc dept

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 DEPTNO                                             NUMBER(2)
 DNAME                                              VARCHAR2(14)
 LOC                                                VARCHAR2(13)

SQL> This will work whether the table is empty or not.

I hope this helps,

Steve

Karsten Wutzke wrote:

> Hi all!
>
> Is there an SQL statement to show all columns of a table? That is, with
> or without any entries... Oh BTW, is there a way to achieve this for an
> EMPTY table?
>
> Thanks from a newbie!
>
> Karsten
  Received on Sun Aug 12 2001 - 06:39:55 CDT

Original text of this message

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