Contents IndexChapter 23.  Importing and Exporting Data Exporting data from a database

User's Guide
   Part III. Using SQL Anywhere
     Chapter 23. Importing and Exporting Data
      Import and export overview

SQL Anywhere supports import and export of individual tables or a complete database using text files. Importing and exporting data to other formats, such as spreadsheet program formats, is available from the ISQL utility.

The LOAD TABLE statement and the UNLOAD TABLE statement are the SQL statements for loading and unloading tables using text files. The INPUT statement and the OUTPUT statement are ISQL commands for importing and exporting data using a variety of formats.

You can unload individual tables or a complete database from SQL Central, using the Unload Database wizard. You can also unload individual tables or a complete database using the DBUNLOAD command line utility. The DBUNLOAD utility is accessible from ISQL.

This chapter describes the LOAD TABLE and UNLOAD TABLE SQL statements, as well as the use of SQL Central, DBUNLOAD, and ISQL to import and export data.

Top of page


Input and output data formats

The LOAD TABLE and UNLOAD TABLE import and export text files, with one row per line, and values separated by a delimiter.

The ISQL INPUT and OUTPUT statements support the following file formats:

File Format Description
ASCII A text file, one row per line, with values separated by a delimiter. String values are optionally enclosed in apostrophes (single quotes). This is the same as the format used by LOAD TABLE and UNLOAD TABLE
DBASEII DBASE II format
DBASEIII DBASE III format
DIF Data Interchange Format
FIXED Data records are in fixed format with the width of each column either the same as defined by the column's type or specified as a parameter
FOXPRO FoxPro format
LOTUS Lotus workspace format
WATFILE WATFILE format. There is an ISQL option for the default input format and one for the default output format. For details on how to specify this option, see "SET OPTION statement". Alternatively, the file format can be specified on each INPUT statement or OUTPUT statement

Top of page


Contents IndexChapter 23.  Importing and Exporting Data Exporting data from a database