Exporting Data From A Database; Using Output Redirection - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Exporting data from a database

Exporting data from a database

Using output redirection

174
This section tells how to export data from an Adaptive Server IQ database.
To export IQ data from your database in this version of Adaptive Server
Note
IQ, Sybase recommends that you use the method described in this chapter. You
may also export data by using a front end tool, written by you or a third party,
that effectively queries the IQ database and formats the data as desired.
If you need to export tables (other than your system tables) from your Catalog
Store, use the method in this chapter, or see the Adaptive Server Anywhere
Reference Guide for other ways to unload data.
Output redirection can be used to export query results.
You can redirect the output of any command to a file or device by putting the
redirection symbol anywhere on the command. The redirection symbol
>#
must be followed by a file name. (In a command file, the file name is then
followed by the semicolon used as statement terminator.) The file is placed
relative to the directory where DBISQL was started.
In this example, output is redirected to the file empfile:
SELECT *
FROM employee
># empfile
Do not enclose the file name in quotation marks.
Output redirection is most useful on the
option to control the format of the output file and the
OUTPUT_FORMAT
option to control truncation. For example, the following
OUTPUT_LENGTH
commands set the format to ASCII text and does not truncate column contents:
SET OPTION OUTPUT_FORMAT = 'text'
SET OPTION OUTPUT_LENGTH = 0
Use two
characters in a redirection symbol instead of one (for example,
>
to append the output to the specified file instead of replacing the contents of the
file. Headings are included in the output from the
output starts at the beginning of the specified file and the output format
supports headings.
statement. Use the
SELECT
statement if the
SELECT
),
>>#

Advertisement

Table of Contents
loading

Table of Contents