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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to get the structure of some tables

Re: How to get the structure of some tables

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Fri, 14 Nov 2003 05:40:55 +1100
Message-ID: <3fb3d040$0$13968$afc38c87@news.optusnet.com.au>

"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

Original text of this message

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