Skip to Main Content
Oracle SQL*Plus Pocket Reference
book

Oracle SQL*Plus Pocket Reference

by Jonathan Gennick
April 2000
Intermediate to advanced content levelIntermediate to advanced
94 pages
1h 52m
English
O'Reilly Media, Inc.
Content preview from Oracle SQL*Plus Pocket Reference

Name

COPY

Synopsis

COPY {FROM connection | TO connection}
     {APPEND | CREATE | INSERT | REPLACE} 
     destination_table [(column_list)]
     USING select_statement

The 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 employee

Parameters

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.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle SQL*Plus Pocket Reference, 3rd Edition

Oracle SQL*Plus Pocket Reference, 3rd Edition

Jonathan Gennick
Expert Oracle Exadata

Expert Oracle Exadata

Kerry Osborne, Randy Johnson, Tanel Pöder

Publisher Resources

ISBN: 1565929411Catalog PageErrata