Name

COPY

Synopsis

COPY {[FROM username[/password]@database_spec] |
TO username[/password]@database_spec] |
[FROM username[/password]@database_spec TO username[/password]@database_spec}
{APPEND | CREATE | INSERT | REPLACE} 
destination_table [(column[,column ...])]  USING query)

Copies data returned from a query to another table in either the local or remote database.

username

The name of the user account (schema) from which and to which data will be copied.

password

The password associated with the specified user account.

database_spec

The SQL*Net connect string for the database being connected to.

TO

Specifies the username, password, and database_spec for the database to which data is to be copied. If TO is omitted, the account SQL*Plus is currently logged into will be used.

FROM

Specifies the username, password, and database_spec for the database from which data is to be copied. If FROM is omitted, the account SQL*Plus is currently logged into will be used.

APPEND

Causes rows to be inserted into destination_table if it exists; otherwise, destination_table is created.

CREATE

Creates destination_table before inserting rows. If destination_table already exists, an error results.

INSERT

Causes rows to be inserted into destination_table. If destination_table does not exist, an error results.

REPLACE

Replaces the destination_table with the results of the query. If destination_table does not exist, it will be created.

destination_table

The name of the table to be created or the table to which rows are being added.

column

The name of a column in destination_table in which data will be inserted. If columns are specified, the number of columns must match those being returned by the query.

query

Any valid SQL SELECT statement that returns the rows and columns that COPY will copy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset