You can copy certain columns or certain rows from one table to another using Migrate's query feature. You can also use this feature to combine data from different tables into one result.
See Replicating Data if you wish to update, insert, or delete specific rows and columns.
Migrate's query feature is designed to migrate tables. It is not an all-purpose SQL processor. Do not use it to perform any SQL other than a single SELECT statement; for example, do not try to CREATE or DROP a location. If you need to include SQL with your migration, use prologue and epilogue scripts. See Adding SQL to a Migration.
The procedure in this section describes how to create a query and migrate its result. Before you begin, review the following prerequisites:
Open the Catalog Browser by selecting the
Catalog Browser button on the toolbar. Open the Schema Viewer by selecting
New from the
File menu.
For more information about system catalog tables, see the SQL Reference or consult your XDB Server Administrator.
The location to which you want to migrate the results of your query must already exist. If it does not, you must first create it using a database management tool such as SQLWizard.
If a location to which you want to migrate records is not listed in the drop-down list, check that you are connected to the correct server and verify that the server has access to the location you need. See your XDB Server Administration Guide or consult your XDB Server Administrator for information about server-to-server communications.
You can enter any valid SELECT statement, even those containing joins and unions.
To ensure a successful query, specify your tables using fully-qualified (i.e., three-part) names.
The following are examples of valid query statements:
SELECT * FROM tutorial.tutorial.employee WHERE city = 'miami' SELECT e_no, lname, city FROM tutorial.tutorial.employee SELECT pname, qty FROM tutorial.tutorial.part p1, tutorial.tutorial.partsupp p2 WHERE p1.pno = p2.pno
If you need specific information about an option in this dialog box, click Help or see Query Options.
Select this option... | To request... |
---|---|
Generate SQL | A copy of the SQL script used to execute the migration. (This script contains the DDL statements used to define the destination table, but does not contain the individual INSERT statements for each migrated record.)
In the text-entry field next to the checkbox, type the name of the file to which you want the script written. If this file does not exist, Migrate creates it. If it exists, Migrate overwrites it with the new SQL script. |
Post Execution Report | A report that lists the tables that were migrated.
In the text-entry field next to the checkbox, type the name of the file to which you want the report written. If this file does not exist, Migrate creates it. If it exists, Migrate overwrites it with the new report. You can specify the same file name for the Post Execution Report and the Error File to combine these two reports into one file. |
Error File | A report that lists any errors encountered during the migration. If there are no errors during the migration, this error file will be empty.
In the text box, type the name of the file to which you want the errors written. If this file does not exist, Migrate creates it. If it exists, Migrate overwrites it with the new report. You can specify the same file name for the Error File and the Post Execution Report to combine these two reports into one file. |
If you want to produce a report describing the effect of the specified migration, select the Impact Analysis Report. This option gives you a report that describes the schemas of the currently selected source and destination tables without performing the migration. See Generating Reports for more information about this and other reports.
When a migration is processed, queries are processed after any tables in the Schema Viewer. When multiple queries are specified, they are processed in window-number order.