# IBM Db2 - Export query result

The export function runs a SQL query and exports its result set as a CSV file. The system uploades the CSV file to a local directory, or to cloud storage, such as an S3 bucket.

If using a local directory to upload the CSV file, the system processes and stores the query results locally, and the data never leaves your secure network.

# Export query result

# Input fields

Required field
Provide the SQL query to select data for export. <br/ ><br/ > Wrap datapills in single quote characters, <code>'</code>.
Column delimiter
Required field
Choose a delimiter character. Commonly, CSV files typically use comma.
Upload URL
Required field
Export the CSV file to this URL. Generate this url using <a href="/connectors/on-prem-files/generate-on-prem-file-url.html">On-prem files</a>, or <a href="/connectors/s3/action-presign-url.html">Amazon S3</a>.

# Output fields

Number of rows exported
The number of rows exported to the CSV file.
Column names
Column headers in the exported CSV file.