Skip to main content Skip to complementary content

cSQL

Reads from and writes to any database using a SQL connection based on a query.

For more information, see the Apache camel documentation https://camel.apache.org/components/latest/.
Information noteNote: This component is available only if you have installed the R2022-11 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

cSQL Standard properties

These properties are used to configure cSQL running in the Standard Route framework.

The Standard cSQL component belongs to the Connectivity family.

Basic settings

Properties Description

Datasource

Select the component that opens the database connection to be reused by this component.

Output Type Select the type of the output data.
  • SelectOne: Make the output as single Java object.
  • SelectList: Make the output as list of maps.
  • StreamList: Use an iterator to stream the output.
Batch Mode Select this checkbox to execute the statement in batch mode.
Use SQL statement from message body

Select this check box if your query statement is specified in the message body.

Type Select the source type of the SQL query. This option is not available if Use SQL statement from message body is enabled.
  • Built-In: The query statement will be entered directly within the component.
  • Repository: The query statement will be selected from an existing repository resource file.
  • File Path: The query statement will be selected from the local file system.
Query This option appears when Built-In is selected from the Type list. Specify a database query statement, paying particularly attention to the proper sequence of the fields which must correspond to the schema definition.

If you have installed the R2025-12 Talend Studio Monthly update or a later one delivered by Talend, you can use multi-lines and format the SQL statement as you want. You can also click [...] next to the Query code box to open the SQL Builder and create a query in it. For more information, see Creating queries using the SQLBuilder.

Resource

This option appears when Repository is selected from the Type list. Select the resource query statement file from the repository. Select the version of the query statement in the Version field if more than one version of the query statement is available.

Resource File

This option appears when File Path is selected from the Type list. Enter the path to the query statement file in your local file system.

Advanced settings

Properties Description
Return generated keys from Inserts Select this checkbox to retrieve the generated keys when inserting data into a table configured with an auto-incrementing key using cSQL. The generated keys are contained in the message header CamelSqlGeneratedKeyRows. For more information on the message headers supported by cSQL, see Message Headers.

To specify which generated columns should be retrieved, click [+] as many times as required to add rows to the Expected keys table and enter the column names.

Information noteNote: This option is available only if you have installed the R2025-12 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

URI Options

Set the optional arguments in the corresponding table. Click [+] as many times as required to add arguments to the table. In the Name field, you can either select the URI option from the drop-down list, or enter an option name that is not available in the list. Then click the corresponding Value field and enter a value. See the site https://camel.apache.org/components/latest/sql-component.html for available URI options.

Usage

Usage guidance Description

Usage rule

cSQL can be a start, middle or end component in a Route. It has to be used with the cSQLConnection component, which creates a connection to the database. For more information about cSQLConnection, see cSQLConnection.

Limitation

 n/a

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!