Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy a table in oracle 1

Status
Not open for further replies.

joeythelips

IS-IT--Management
Aug 1, 2001
305
IE
Hi,

I want to copy a whole table and its contents.

Can i do this in sqlplus?

I need the copy for testing purposes.
 
Try this:

CREATE TABLE MyTable2 AS
SELECT * FROM MyTable1; Terry M. Hoey
 
Don't do this if you have default values set in any column as they are not carried across. Also this will not work if you have LONG columns.

Alex
 
Also, triggers, indexes, and constraints (except NOT NULL) will not be copied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top