Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get the structure of some tables
"Karim Bernardet" <bernardet.karim_at_wanadoo.fr> wrote in message
news:bp064h$hls$1_at_ccpntc8.in2p3.fr...
> Hello,
>
> I have to modify some tables from an oracle 9 database. So I would like to
> export the structure of those tables to recreate them on a development
database
> (oracle 8). So how can I do that ?
>
> Thanks for your help
>
> Karim.
In SQL Plus, do the following:
SQL> set long 4000 SQL> spool createtable.txt SQL> select dbms_metadata.get_ddl('TABLE','nameoftablehere') from dual; SQL> spool off
Now edit createtable.txt, and strip out the odd bit of rubbish. You now have a script that will recreate a table. Just connect to your Oracle 8 database, and execute it:
SQL>@createtable.txt
Regards
HJR
Received on Thu Nov 13 2003 - 12:40:55 CST