Collection Contents Index CHAPTER 11.  Importing and Exporting Data Exporting data from a database pdf/chap11.pdf

User's Guide
   PART 1. Working with Databases
     CHAPTER 11. Importing and Exporting Data       

Import and export overview


Adaptive Server 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 Interactive SQL 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 Interactive SQL commands for importing and exporting data using a variety of formats.

You can unload individual tables or a complete database from Sybase 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 Interactive SQL.

This chapter describes the LOAD TABLE and UNLOAD TABLE SQL statements, as well as the use of Sybase Central, DBUNLOAD, and Interactive SQL 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 Interactive SQL 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 a Interactive SQL option for the default input format and one for the default output format. For details on how to specify these options, see INPUT_FORMAT option and OUTPUT_FORMAT option.

The file format can alternatively be specified on each INPUT statement or OUTPUT statement.

Top of page  

Collection Contents Index CHAPTER 11.  Importing and Exporting Data Exporting data from a database pdf/chap11.pdf