Exporting data from a database
174
Exporting data from a database
This section tells how to export data from an Adaptive Server IQ database.
Note
To export IQ data from your database in this version of Adaptive Server
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.
Using output redirection
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
SELECT
statement. Use the
OUTPUT_FORMAT
option to control the format of the output file and the
OUTPUT_LENGTH
option to control truncation. For example, the following
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
SELECT
statement if the
output starts at the beginning of the specified file and the output format
supports headings.
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...