The INSERT statement
The INSERT statement tells the archecker utility what tables to extract and where to place the extracted data.
Syntax
Element | Description |
---|---|
filter | The following filters are supported by the INSERT
statement:
The following operators are not supported by the archecker utility:
Filters can only be applied to physical-only restore. |
src_column | A list of columns to be extracted. |
src_table | The source table on the archive where the data is restored from. |
target_column | The destination column or columns where the data will be restored. |
target_table | The destination table where the data will be restored. |
Examples
The following
example demonstrates the simplest form of the INSERT statement. This
statement extracts all rows and columns from the source to the target
table.
INSERT INTO target SELECT * FROM source;
You
can also extract a subset of columns. In the following example, only
two columns from the source table are inserted into the destination
table.
CREATE TABLE source (col1 integer, col2 integer, col3 integer, col4 integer);
CREATE TABLE target (col1 integer, col2 integer);
INSERT INTO target (col1, col2) SELECT col3, col4 FROM source;