UNLOAD statement
UNLOAD statement
Function
Syntax
Permissions
Side effects
See also
Description
Parameters
Standards and
compatibility
634
Use this statement to export data from a database into an external ASCII-
format file.
UNLOAD select-statement
... TO ' filename - string '
[ unload-option ... ]
unload-option :
DELIMITED BY string
| ESCAPE CHARACTER character
| ESCAPES {ON | OFF}
| FORMAT {ASCII | BCP}
| HEXADECIMAL {ON | OFF}
| ORDER {ON | OFF}
| QUOTES {ON | OFF}
The permissions required to execute an UNLOAD statement are set on the
database server command line, using the
$
For more information, see "–gl command-line option" on page 27.
None. The query is executed at the current isolation level.
"UNLOAD TABLE statement" on page 635
"OUTPUT statement" on page 573
The UNLOAD statement allows the result set of a query to be exported to a
comma-delimited file. The result set is not ordered unless the query itself
contains an ORDER BY clause.
When unloading result set columns with binary data types, UNLOAD writes
hexadecimal strings, of the form \xnnnn where n is a hexadecimal digit.
$
For a description of the unload-option parameters, see "UNLOAD
TABLE statement" on page 635.
filename-string
The filename to which the data is to be unloaded.
Because it is the database server that executes the statements, filenames
specify files on the database server machine. Relative filenames specify files
relative to the database server's starting directory. To unload data onto a
client machine, see "OUTPUT statement" on page 573.
♦
Vendor extension.
SQL/92
♦
Sybase
UNLOAD is not supported by Adaptive Server Enterprise.
command-line option.
–gl
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers