SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

Copying Data between Tables on One Database

You can copy data from one table to another in a single database (local or remote). To copy between tables in your local database, specify your own username and password and the database specification for your local database in either a FROM or a TO clause (omit the other clause):

SQL> COPY FROM SCOTT/TIGER@MYDATABASE -
>  INSERT EMPCOPY2 -
>  USING SELECT * FROM EMP

To copy between tables on a remote database, include the same username, password, and database specification in the FROM and TO clauses:

SQL> COPY FROM SCOTT/TIGER@BOSTONDB -
>  TO SCOTT/TIGER@BOSTONDB -
>  INSERT EMPCOPY2 -
>  USING SELECT * FROM EMP


Contents Index Home Previous Next