Exporting Data
COPY TO
COPY TO
<file path>
must be a path on the server. This command exports the results of any SELECT statement to the file. There is a special mode when <file path>
is empty. In that case, the server automatically generates a file in <OmniSci Directory>/omnisci_export
that is the client session id with the suffix .txt
.
Available properties in the optional WITH clause are described in the following table.
Parameter | Description | Default Value |
| A single-character string for the delimiter between column values; most commonly:
Other delimiters include Note: OmniSci does not use file extensions to determine the delimiter. |
|
| A single-character string for escaping quotes. |
|
| Either |
|
| A single-character string for terminating each line. |
|
| A string pattern indicating that a field is NULL. | An empty string, |
| A single-character string for quoting a column value. |
|
| Either |
|
When using the COPY TO
command, you might encounter the following error:
To avoid this error, use the omnisql
command \cpu
to put your OmniSci server in CPU mode before using the COPY TO
command. See Configuration.
Example
Last updated