Partial data copy can be performed from a source view to a target table or view by specifying a WHERE clause and key columns. This is very similar to partial copy of data tables.
<views> <view selection="included" copyData="true"> <name>deptsals</name> <database>MyDb</database> <view_data_table> <target_table>TargetTable</target_table> <target_database>TargetDb</target_database> </view_data_table> <staging_database> <name>TargetDb_Staging</name> </staging_database> <compare_ddl>true</compare_ddl> <sql_where_clause><![CDATA[ WHERE "deptsals"."employee_number" = 1]]></sql_where_clause> <key_columns> <key_column>employee_number</key_column> </key_columns> </view> </views>
In the example here, a SELECT statement with a WHERE clause is used to select data from the view where "employee_number" = 1 and load the partial data to the target table. Key columns must be specified when a SQL WHERE clause is specified.
When performing a partial copy of view data to a target view, the qualifying rows are first copied to a staging table. After the rows are copied to the staging table, the qualifying records in the WHERE clause are copied from the staging table to the target view. This process is similar to a partial table copy when the target table exists with data.