Use the Interactive SQL Import Wizard to select a source, format, and destination table for the data. You can import data from TEXT and FIXED format files. You can import data into an existing table or a new table. You can also use the Import Wizard to import data between:
databases of different types, such as between a SQL Anywhere database and an UltraLite database.
databases of different versions (as long as you have an ODBC driver for each database), such as between a SQL Anywhere 12 database and a SQL Anywhere 11 database.
Use the Interactive SQL Import Wizard when you:
want to create a table at the same time you import the data
prefer using a point-and click interface to import data in a format other than text
In Interactive SQL, choose Data » Import.
Follow the instructions in the Import Wizard.
Create and save a text file named import.txt with the following values (on a single line):
100,500,'Chan','Julia',100,'300 Royal Drive', 'Springfield','OR','USA','97015','6175553985', 'A','017239033',55700,'1984-09-29',,'1968-05-05', 1,1,0,'F' |
In Interactive SQL, choose Data » Import.
Select In A Text File and click Next.
In the File Name field, type import.txt.
Select In An Existing Table.
Select Employees and click Next.
In the Field Separator list, select Comma(,). Click Next.
Click Import.
Click Close.
The SQL statement created by the wizard is stored in the command history when the import finishes.
You can view the generated SQL statement; from the SQL menu, choose Previous SQL.
The IMPORT statement generated by the Import Wizard appears in the SQL Statements pane:
-- Generated by the Import Wizard INPUT INTO "GROUPO"."Employees" from 'C:\\Tobedeleted\\import.txt' FORMAT TEXT ESCAPES ON ESCAPE CHARACTER '\\' DELIMITED BY ',' ENCODING 'Cp1252' |
Connect to an UltraLite database, such as, C:\Documents and Settings\All Users\Documents\SQL Anywhere 12\Samples\UltraLite\CustDB\custdb.udb.
In Interactive SQL, choose Data » Import.
Click In A Database. Click Next.
In the Database Type list, choose SQL Anywhere.
From the Action dropdown list, choose Connect With An ODBC Data Source.
Click ODBC Data Source Name, and then type in the box below, SQL Anywhere 12 Demo.
Click Next.
In the Table Name list, select Customers. Click Next.
Click In A New Table.
In the Owner field, type dba.
In the Table Name field, type SQLAnyCustomers.
Click Import.
Click Close.
To view the generated SQL statement, choose SQL » Previous SQL.
The IMPORT statement created and used by the Import Wizard appears in the SQL Statements pane.
-- Generated by the Import Wizard INPUT USING 'DSN=SQL Anywhere 12 Demo;CON=''''' FROM "GROUPO.Customers" INTO "dba"."SQLAnyCustomers" CREATE TABLE ON |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |