Using the Interactive SQL Export Wizard

You can use the Interactive SQL Export Wizard to export query results.

Use this export tool when you want to save result sets to a file or database. In Interactive SQL, from the Data menu, choose Export. This allows you to choose the file format of the exported query results.

Examples

The following example shows you how to export a result set from a SQL query to a file.

To export result sets data using Interactive SQL

  1. Execute a query.

  2. In Interactive SQL, choose Data » Export .

  3. Follow the instructions in the wizard.

The following example shows you how to export a result set from a SQL query to a database.

To export result sets data to an UltraLite database using Interactive SQL

  1. Execute the following query while connected to the SQL Anywhere sample database.

    SELECT * FROM Employees
    WHERE State = 'GA';

    The result set includes a list of all employees who live in Georgia.

  2. Choose Data » Export.

    The Export Wizard appears.

  3. Select In A Database.

  4. From the Database Type list, select UltraLite.

    On the Identification tab, type dba and sql in the User Id and Password fields, respectively. In the Database File, type C:\Documents and Settings\All Users\Documents\SQL Anywhere 11\Samples\UltraLite\CustDB\custdb.udb.

  5. Click Next.

  6. Select In A New Table, type dba and NewTable, for the Owner and Table Name respectively, and then click Export.

    The result set is exported to the table that you specified.

  7. From the SQL menu, choose Previous SQL.

    The IMPORT statement created and used by the Import Wizard appears in the SQL Statements pane:

    --  Generated by the Export Wizard
    OUTPUT USING 'driver=UltraLite 11;UID=dba;PWD=sql;
    DBF=C:\Documents and Settings\All Users\Documents\SQL Anywhere 11\Samples\UltraLite\CustDB\custdb.udb' 
    INTO "dba"."NewTable" 
    CREATE TABLE ON