Home » SQL & PL/SQL » SQL & PL/SQL » copy contents of a table to a new table
copy contents of a table to a new table [message #8331] Sun, 10 August 2003 07:41 Go to next message
hrishita
Messages: 13
Registered: August 2003
Junior Member
How to copy the contents of a table to another table after creating the second table.
These steps of creating the second table and copying the contents of first table to second table has to be in a single SQL statment

Can we do with copy command ? I tried but couldn't get it
Re: copy contents of a table to a new table [message #8336 is a reply to message #8331] Sun, 10 August 2003 17:04 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
COPY is not an SQL statement. It's a (deprecated) SQL*Plus command.

Try INSERT, or else CREATE TABLE newtab AS SELECT cols FROM oldtab;
Re: copy contents of a table to a new table [message #8340 is a reply to message #8331] Mon, 11 August 2003 06:00 Go to previous messageGo to next message
Zia Khattak
Messages: 22
Registered: July 2003
Junior Member
TRY THIS:

CREATE TABLE EMPNEW AS SELECT * FROM EMP;

IF YOU DONT WANT TO TRANSFER DATA THEN:

CREATE TABLE EMPNEW AS SELECT * FROM EMP
WHERE 1=2;
Re: copy contents of a table to a new table [message #8344 is a reply to message #8340] Mon, 11 August 2003 21:43 Go to previous message
hrishita
Messages: 13
Registered: August 2003
Junior Member
got it thanx
Previous Topic: Where i will configure the job?
Next Topic: procedure/function parameter as a record or table
Goto Forum:
  


Current Time: Thu Apr 18 20:15:23 CDT 2024