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: Informix vs Oracle. SOme questions.

Re: Informix vs Oracle. SOme questions.

From: Steven Patenaude <stevenp_at_coop.com>
Date: 1998/02/04
Message-ID: <01bd30d7$1183e3c0$8a8c429f@stevenp.ccird>#1/1

Jerry Gitomer <jgitomer_at_p3.net> wrote in article <34D6A5FD.3887_at_p3.net>... <deleted>
> You can use
>
> "CREATE TABLE <table_name> AS SELECT * FROM <old_table_name>;"
>
> This will create a copy of the existing table with a different
> name.
>
> If you only want to copy the structure and not retain the data
> (assuming that your tables don't have very many rows of data) do
> the above to create a table and then:
>
> "TRUNCATE TABLE <table_name>;"
>
> This will instantly drop the data without destroying either the
> table structure or the indexes.
>

You can also try

"CREATE TABLE <table_name> AS SELECT * FROM <old_table_name> WHERE 0=1;"

That way you don't move a bunch of data unnecessarily.

> "SPOOL <file_name>" -- note the ommission of the semi-colon on this
> "SELECT * FROM <table_name>;"
> "SPOOL OFF"
>
> This sequence will create a flat file but, unlike Informix UNLOAD,
> it will contain fixed length records rather than variable length
> records. To reload the data back into the same or another table
> with the same structure use the SQL*Loader utility from the
> operating system command line or, if using NT, the appropriate menu.

You should also set some of the SQL*Plus options, too, to get rid of column headers, row count, command echo, etc.

HTH,
Steven Received on Wed Feb 04 1998 - 00:00:00 CST

Original text of this message

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