Name
COPY
Synopsis
COPY {FROM connection | TO connection}
{APPEND | CREATE | INSERT | REPLACE}
destination_table [(column_list)]
USING select_statementThe COPY command allows you to use SQL*Plus as a conduit for transferring data between two Oracle databases. For example:
copy from jeff/bigkid@empdb -
create emp_names (id, name) -
USING SELECT employee_id, employee_name -
FROM employeeParameters
- FROM/TO
Specifies either the target or the source database. You must be connected to one database. Use this clause to specify the other.
- connection
Is the login information to use when connecting to the other database. This must be in the typical username/password@connect_string format.
- APP[END]
Causes SQL*Plus to insert the copied rows into the destination table. If necessary, SQL*Plus will create the destination table first.
- CRE[ATE]
Causes SQL*Plus to copy the data only if the destination table is a new table.
- INSERT
Causes SQL*Plus to insert the copied rows into the destination table only if it already exists.
- REP[LACE]
Causes SQL*Plus to delete and recreate the destination table if it currently exists.
- destination_table
Is the name of the table to which you want to copy the data.
- column_list
Specifies column names to use when the COPY command creates a new destination table. This is a comma-delimited list, and the number of column names must match the number of columns in the SELECT statement.
- select_statement
Is a SELECT statement that returns the data you want to COPY.