Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL and DESC
Describe is a Sql/plus command not an oracle command:
try to select in system table ALL_TAB_COLUMNS WHERE TABLE_NAME = YourTable
HTH,
Philippe
dennishancy_at_eaton.com wrote in message <7o9f5v$brv$1_at_nnrp1.deja.com>...
>
>
>I'm at the lowest possible level of the PL/SQL learning curve here...
>
>My goal is to write a script (I believe this is PL/SQL??) that will
>describe all tables.
>
>So, I began by creating a cursor, that looks like this:
>
>cursor c is
> select table_name
> from all_tables
> where table_name like '%BANK%';
>
>
>In the begin/end block, I simply (??) loop through this cursor to get
>each table name one at a time. My thought was that I would just do a
>"desc" on each of these. It looks like this:
>
>
>loop
> fetch c into field; (field is declared as a char(30)
> exit when c%notfound;
> describe field
>end loop;
>
>
>When I go to run this, it produces an error saying it wasn't expecting
>the word "field" after describe.
>
>What's wrong? What am I missing? Help!!!!
>
>Can anyone suggest a book that will give me a very basic understanding
>of SQL, PL/SQL, and SQL*Plus and how this all fits together? I am
>really really confused. Thanks in advance...
>
>
>Dennis Hancy
>Eaton Corporation
>Cleveland, OH
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Wed Aug 04 1999 - 09:52:25 CDT