Overview
A delimiter is a character that separates text strings. Common delimiters include:- Commas (,)
- Semicolon (;)
- Quotes ( ”, ’ )
- Dash (-)
- Pipes (|)
- Slashes ( / \ ).
Syntax
The syntax forCOPY TO
with a delimiter is as follows:
table_name
: The table containing the data to be exported.file_path
: The CSV file location where the data will be saved.DELIMITER ‘delimiter'
: The Delimiter used in the exported CSV file.
Default delimiter is a comma (
,
).Example
Step #1: Create a Table
- Before creating a table, check for duplicate tables using the following statement:
- You will receive a list of existing tables in Oxla:
Ensure you are not creating duplicate tables.
- Create a “customer” table.
- The table and data were created successfully.
Step #2: Export Data to a CSV File using Delimiter
Important Notes:
- By default, the
- Please ensure that the directory where you save the file has a write permissions.
- By default, the
COPY TO
command overwrites the CSV file if it already exists. - Please ensure that the directory where you save the file has a write permissions.
,
).
,
) as the delimiter for the customer
table, the expected output would be: