Activity - sqlResultsToCSV

Activity Type: Relational

Description

Convert the results of an SQL query or a stored procedure into CSV (Comma Separated Value) format.

Unfortunately, there is currently no such thing as CSV format. Flexible format used here conforms to the following guidelines:

NOTE ON LINE BREAKS

Example

<sqlResultsToCSV name="results">
<resultSet from="sqlStatement" />
<csvOutput name="CSV" />
<delimiter value="," />
<lineBreak value="LFCR" />
<nullDataStr value="NULL" />
<includeHeader value="true" />
<escapeFields value="true" />
</sqlResultsToCSV>

Example output

"id","name","address","phone"
1,"Ally Antonioletti","826 Hume Crescent, Southampton","01670061244"
2,"Amy Atkinson","583 Atkinson Drive, Southampton","06312054624"

Specification

Element sqlResultsToCSV:

Input and Output Types

Data Resource Accessor

This activity can operate with any data resource accessor.

XML Schema

OGSA-DAI/schema/ogsadai/xsd/activities/sql_results_to_csv.xsd

Class

uk.org.ogsadai.activity.sql.SQLResultsToCSVActivity

Client Toolkit Class

uk.org.ogsadai.client.toolkit.activity.sql.CSV