Valid in: SQL, ESQL
The copy statement copies the contents of a table to a data file (copy into) or copies the contents of a file to a table (copy from). The following table briefly describes the valid statement parameters. Details about the parameters are provided in the following sections. For more information on the copy statement, see "Populating Tables" in the Database Administrator Guide.
The Copy statement has the following format:
[EXEC SQL] COPY [TABLE] [schema.]table_name
([column_name = format [WITH NULL [(value)]]
{, column_name = format [WITH NULL [(value)]]}])
INTO | FROM 'filename[, type]'
[with-clause]
Specifies an existing table from which data is read or to which data is written.
Specifies the column from which data is read or to which data is written.
Specifies the format in which a value is stored in the file.
Specifies the file from which data is read or to which data is written.
Specifies the file type: text, binary, or variable. (Optional) On VMS platforms only.
Consists of the word WITH, followed by a comma-separated list of one or more of the following items:
The following options are valid for bulk copy operations only. For details about these settings, see Modify. The value specified for any of these options becomes the new setting for the table and overrides any previously made settings (either using the MODIFY statement or during a previous copy operation).