print database object [message #183157] |
Wed, 19 July 2006 13:12  |
limbe
Messages: 20 Registered: July 2006 Location: Limbe, Cameroon
|
Junior Member |
|
|
hello,
I ve create a database (oracle 10g) and added some tables. I want to print the desription of these table for documentation.
How do i do it
Thanks
Hugues
|
|
|
Re: print database object [message #183168 is a reply to message #183157] |
Wed, 19 July 2006 14:30  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Using some tool (like TOAD or SQL Developer) makes things easy; in SQL*Plus, you could create your own script:SET SERVEROUTPUT ON SIZE 1000000;
SPOOL desc.sql
BEGIN
FOR cur_r IN (SELECT tname FROM tab WHERE tabtype = 'TABLE') LOOP
dbms_output.put_line('prompt ' || cur_r.tname);
dbms_output.put_line('describe ' || cur_r.tname);
END LOOP;
END;
/
SPOOL OFF;
SPOOL described_tables.txt
@desc.sql
SPOOL OFF; This should be tweaked a little bit (kick out lines you don't need etc.), but - generally speaking - this should do it.
|
|
|