SQL Statements Overview

Use this option to generate a file containing standard SQL CREATE, INSERT, INDEX, SYNONYM, CHECK, and COMMENT ON commands that will allow a table or view and the data it contains to be re-created in another SQL environment. This option generates a standard Batch SQL file that can be used directly by SQLWizard's Batch SQL or other SQL DBMS applications. You can run an exported SQL file on a mainframe DB2 system as a means of copying tables and data from XDB Server to DB2.

The standard SQL commands you can create with this Export format are:

When you use the Browse button to choose a target file, export will search for the selected file format. The SQL Statement format is indicated by the file name extension .SQL.

Specify what types of SQL statements you would like to have generated from the source table or view by clicking on the desired SQL statement checkboxes. The table below describes each option.

SQL Option Generated SQL Statements
CREATE Generates a CREATE TABLE or CREATE VIEW statement that will re-create the table or view when the exported SQL file is run in Batch SQL.
INSERT Generates INSERT INTO statement(s) that will insert the source table data into the re-created table or view when the exported file is run in Batch SQL.
INDEX Generates CREATE INDEX statement(s) that will create index(es) for the recreated table when the exported file is run in Batch SQL.
SYNONYM If synonyms exist for the source table (or view) or for any columns in the source table, this option generates CREATE SYNONYM statement(s) that will create the same synonyms when the exported file is run in Batch SQL.
CHECK If exporting a table, this option generates an ALTER TABLE command with the CHECK option. You can modify the statement to define the conditions for the check constraint.

If exporting a view that was originally created using the WITH CHECK OPTION, the WITH CHECK OPTION is included in the CREATE VIEW statement generated by this utility.

COMMENT Generates COMMENT ON statement(s) for the table and for each column.
SQL Statement Option Description
DB2 Options for CREATE TABLE Enter DB2 options if you are planning to run your exported SQL file on a mainframe DB2 system. Click the Create (Create Table) checkbox to select it, and then click the DB2 button to the right of it to specify mainframe options for the IN DATABASE clause to be generated.

These options make the SQL statements more compatible with your target environment.

DB2 Options for CREATE INDEX Enter DB2 options if you are planning to run your exported SQL file on a mainframe DB2 system. Click the Index checkbox and then click the DB2 button to the right of it to specify DB2 Create Index options.

These options make the SQL statements more compatible with your target environment.