Easily find issues by searching: #<Issue ID>
Example: #1832
Easily find members by searching in: <username>, <first name> and <last name>.
Example: Search smith, will return results smith and adamsmith
Aqua Data Studio / nhilam |
Follow
827
|
\sqlexport | |
Exports data. | |
Syntax | |
\sqlexport [Option ...] [Table ...] Destination |
|
Description | |
\sqlexport retrieves data from the named Table(s) and writes the result to the Destination file. If more than one tables are specified, Destination is expected to be a folder rather than a file. If no Tables are specified, \sqlexport attempts to execute the SQL statements stored in shell's SQL buffer, and writes the result of queries to Destination. The value provided in the $database variable will be used if no database is specified with the -d option. Data written to Destination can be in one of these formats: delimited data, Excel file, or INSERT statements (see -f option for details). Note: \sqlexport currently requires the RDBMS server be connected using the secure storage. |
|
Options | |
If both short form and long form are specified on the command line, the long form will take precedence. | |
-c, --charset CHARSET The character set to be used for encoding output; supported values are: 'UTF-8' and 'platform-default', defaults to 'UTF-8'. |
|
-d, --database DATABASE The name of the database from which to look up data, defaults to the connected database. |
|
-f, --format FORMAT The output format; supported values are: 'csv', 'INSERT', 'excel', 'excel2007', default to 'csv'. |
|
-l, --line-separator LINE-SEPARATOR The line separator to be used in the output file; supported values are: 'unix', 'windows', defaults to platform's line separator. |
|
-s, --schema SCHEMA The name of the schema from which to look up data. |
|
The following options will take effect if output format is set to 'csv': | |
-DD, --delimiter DELIMITER The delimiter for separating data; defaults to ','. Use words 'tab', 'space' for setting tab character, space character, as delimiter respectively. |
|
-SQ, --string-quote IDENTIFIER String quoted identifier; supported values are: 'double-quote', 'single-quote, 'none', defaults to 'double-quote'. |
|
-CN, --column-names BOOLEAN Include or exclude column names as first row, default to 'true'. See BOOLEAN Values section below for supported BOOLEAN values. |
|
-NT, --null-text BOOLEAN Set or not set text to (null) on NULL values, default to 'true'. See BOOLEAN Values section below for supported BOOLEAN values. |
|
-PD, --date PATTERN Pattern for formatting date, default to 'yyyy/MM/dd' |
|
-PT, --time PATTERN Pattern for formatting time, default to 'hh:mm:ss a'. |
|
The following options will take effect if output format is set to 'INSERT': | |
-PA, --datetime PATTERN connect to Apache Derby: LOCAL, SERVER. |
|
-PA, --datetime PATTERN connect to Apache Derby: LOCAL, SERVER. |
|
-TS, --target-schema SCHEMA The name of the schema to which data to be written, defaults to the schema from which data is retrieved. |
|
-TT, --target-table TABLE The name of the table to which data to be written, default to the source Table name; this option must be specified if no source Tables given on the command line. |
|
-SS, --statement-separator SEPARATOR SQL statement separator; supported values are: 'GO', 'slash, 'semicolon', default to 'GO'. |
|
-OQ, --object-quote IDENTIFIER Object quoted identifier; supported values are: 'double-quote', 'single-quote, 'square-bracket', 'back-quote', 'none', defaults to 'none'. |
|
-CT, --create-table BOOLEAN Include or exclude table CREATE as first statement, defaults to 'false'. See BOOLEAN Values section below for supported BOOLEAN values. |
|
-II, --identity-insert BOOLEAN Enable or disable identity insert, defaults to 'false'. See BOOLEAN Values section below for supported BOOLEAN values. |
|
The following options will take effect if either 'csv' format or 'INSERT' format is set: | |
-DS, --decimal-symbol SYMBOL Decimal symbol; default to '.'. |
|
BOOLEAN Values: The following are supported values: 'true', 'false', 'yes', 'no', 'on', 'off', '1', '0'. |
|
Example | |
To export the table Orders with schema dbo from the database Northwind, use the command below. The output format is csv. \sqlexport -f csv -s dbo Orders D:\fsdemo\order.csv -d Northwind |
|
See Also | |
\disconnect \reconnect |
About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017