Contents IndexUNION operation UPDATE statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      UNLOAD TABLE statement

Function

To export data from a database table into an external ascii-format file.

Syntax

     UNLOAD [ FROM ] TABLE [ owner ].table-name
          ... TO 'filename-string'
          ... [ FORMAT 'ascii'] [ DELIMITED BY string ]
          ... [ QUOTES ON | OFF ] [ ESCAPES ON | OFF ]
          ... [ ORDER ON | OFF ]
          ... [ ESCAPE CHARACTER character ]

Usage

Anywhere.

Permissions

Must have SELECT permission on the table.

Side effects

None.

See also

Description

The UNLOAD TABLE statement allows efficient mass exporting from a database table into an ascii file. UNLOAD TABLE is more efficient than the ISQL statement OUTPUT and can be called from any client application.

UNLOAD TABLE places an exclusive lock on the whole table.

For descriptions of the FORMAT, DELIMITED BY, and ESCAPE CHARACTER options, see "LOAD TABLE statement". The other options are as follows:

QUOTES option With QUOTES turned on (the default), single quotes are placed around all exported strings.

ESCAPES option With ESCAPES on (the default), backslash-character combinations are used to identify special characters where necessary on export.

ORDER option With ORDER on (the default) the data is exported ordered by primary key values. With ORDER off, the data is exported in the same order you see when selecting from the table without an ORDER BY clause.

Exporting is slower with ORDER on. However, reloading using the LOAD TABLE statement is quicker because of the simplicity of the indexing step.

Contents IndexUNION operation UPDATE statement