# tSingleStoreOutput

Executes the action defined on the data contained in the table, based on the flow incoming from the preceding component in the Job.

tSingleStoreOutput writes, updates, makes changes or suppresses entries in any type of database connected to a JDBC API.

## tSingleStoreOutput Standard properties

These properties are used to configure tSingleStoreOutput running in the Standard Job framework.

The Standard tSingleStoreOutput component belongs to the Databases family.

The component in this framework is available in all subscription-based Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Database | Select the desired database type from the list and click<br>Apply. |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul><br><br>This property is not available when other connection component is selected from<br>the Connection Component dropdown list. |
| ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/Save_Icon.png) | Click this icon to open a database connection wizard and store the<br>database connection parameters you set in the component Basic<br>settings view.<br><br>For more information about setting up and storing database connection<br>parameters, see [Centralizing database metadata](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/centralizing-database-metadata). |
| Component list | Select the component that opens the database connection to be reused by this<br>component. |
| JDBC URL | The JDBC URL of the database to be used. For example, the JDBC URL for the Amazon Redshift database is jdbc:redshift://endpoint:port/database. |
| Drivers | Complete this table to load the driver JARs needed. To do<br>this, click the [+] button under the table to add<br>as many rows as needed, each row for a driver JAR, then select the cell and click the<br>[...] button at the right side of the cell to<br>open the Module dialog box from which you can select the driver JAR<br>to be used. For example, the driver jar RedshiftJDBC41-1.1.13.1013.jar for the Redshift database.<br><br>For more information, see [Importing a database driver](https://help.qlik.com/talend/r/en-US/8.0/components/jdbc/importing-database-driver). |
| Driver Class | Enter the class name for the specified driver between double<br>quotation marks. For example, for the RedshiftJDBC41-1.1.13.1013.jar driver, the name to be entered is<br>com.amazon.redshift.jdbc41.Driver. |
| User Id and Password | The database user authentication data.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password in double quotes in the pop-up dialog box,<br>and click OK to save the settings. |
| Table | Enter the name of the table into<br>which data will be written. |
| Data Action | Select an action to be performed on data of the<br>table defined.<br><br><ul> <li> <p> <span>Insert</span>: Add            new entries to the table. If duplicates are found, the Job stops.</p> </li> <li> <p> <span>Update</span>:            Make changes to existing entries.</p> </li> <li> <p> <span>Insert or                update</span>: Insert a new record in the index pool. If the record with the            given reference already exists, an update would be made.</p> </li> <li> <p> <span>Update or                insert</span>: Update the record with the given reference. If the record does            not exist in the index pool, a new record would be inserted.</p> </li> <li> <p> <span>Delete</span>:            Remove entries corresponding to the input flow.</p> </li> </ul><br><br>Information noteWarning:<br><br>It is necessary to specify at least one column as a<br>primary key on which the Update and Delete operations are based. You<br>can do that by clicking Edit Schema and selecting the check box(es)<br>next to the column(s) you want to set as primary key(s). For an<br>advanced use, click the Advanced settings view where you can<br>simultaneously define primary keys for the Update and Delete<br>operations. To do that: Select the Use field options check box and<br>then in the Key in update column, select the check boxes next to the<br>column names you want to use as a base for the Update operation. Do<br>the same in the Key in delete column for the Delete operation. |
| Clear data in table | Select this check box to clear data in the table before performing the<br>action defined. |
| Schema and Edit schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br><ul> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul><br><br>When the schema to be reused has default values that are<br>integers or functions, ensure that these default values are not enclosed within<br>quotation marks. If they are, you must remove the quotation marks manually.<br><br>For more information, see [Retrieving table schemas](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/retrieving-table-schemas?tocId=_C1~eFOlN~GM_JR2qkBYZg).<br><br>Click Edit schema to make changes to<br>the schema. If you make changes, the schema automatically becomes built-in.<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> |
| Guess Schema | Click this button to generate schema columns based on the settings of database table columns. |
| Die on error | Select the checkbox to stop the execution of the Job when an error<br>occurs.<br><br>Clear the checkbox to skip any rows on error and complete the<br>process for error-free rows.<br><br>When errors are skipped, you can collect the rows on error<br>using a Row &gt; Reject connection. |
| Specify a data source alias | Select this checkbox and in the<br>Data source alias field displayed, specify the alias of<br>a data source created on Talend Runtime<br>side to use the shared connection pool defined in the data source configuration.<br>This option works only when you deploy and run your Job in Talend Runtime.<br><br>If you use the component's own DB configuration, your data source<br>connection will be closed at the end of the component. To prevent this from<br>happening, use a shared DB connection with the data source alias specified.<br><br>This property is not available when other connection component is selected from<br>the Connection Component dropdown list. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Commit every | Specify the number of rows to be processed before committing<br>batches of rows together into the database.<br><br>This option ensures transaction quality (but not rollback) and, above all, better<br>performance at executions. |
| Additional Columns | This option allows you to call SQL functions to perform actions on columns, which are<br>not insert, update or delete actions, or actions that require particular preprocessing.<br>It is not offered if you create (with or without drop) the database table.<br><br><ul> <li> <p> <span>Name</span>: The name of the schema column to be inserted, or the                name of the schema column used to replace an existing column.</p> </li> <li> <p> <span>SQL expression</span>: The SQL statement to be executed in order to                insert or replace relevant column.</p> </li> <li> <p> <span>Position</span>: Select <kbd>Before</kbd>,                  <kbd>After</kbd>, or <kbd>Replace</kbd> according to the                action to be performed on the reference column.</p> </li> <li> <p> <span>Reference column</span>: The name of the reference column that can                be used to locate the new column to be inserted or that will be replaced.</p> </li> </ul> |
| Use field options | Select this check box and in the Fields options table<br>displayed, select the check box for the corresponding column to customize a<br>request, particularly if multiple actions are being carried out on the<br>data.<br><br><ul> <li> <span>Key in update</span>: Select the check box for the                            corresponding column based on which data is updated.</li> <li> <span>Key in delete</span>: Select the check box for the                            corresponding column based on which data is deleted.</li> <li> <p> <span>Updatable</span>: Select the check box if data in the                                corresponding column can be updated.</p> </li> <li> <p> <span>Insertable</span>: Select the check box if data in                                the corresponding column can be inserted.</p> </li> </ul> |
| Debug query mode | Select this check box to display each step during processing entries<br>in a database. |
| Use batch | Select this check box to activate the batch mode for data<br>processing, and in the Batch Size field displayed, specify the<br>number of records to be processed in each batch. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |
| Enable parallel execution | Select this check box to perform high-speed data processing by treating<br>multiple data flows simultaneously. This feature depends on the database or<br>the application ability to handle multiple inserts in parallel as well as<br>the number of CPU affected. With this check box selected, you need to<br>specify the number of parallel executions desired in the Number<br>of parallel executions field displayed.<br><br>Information noteNote: When parallel execution is enabled, it is not possible to use global<br>variables to retrieve return values. |

## Global Variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |
| NB\_LINE | The number of rows processed. This is an After variable and<br>it returns an integer. |
| NB\_LINE\_INSERTED | The number of rows inserted. This is an After variable and<br>it returns an integer. |
| NB\_LINE\_UPDATED | The number of rows updated. This is an After variable and it<br>returns an integer. |
| NB\_LINE\_DELETED | The number of rows deleted. This is an After variable and it<br>returns an integer. |
| NB\_LINE\_REJECTED | The number of rows rejected. This is an After variable and<br>it returns an integer. |
| QUERY | The query statement being processed. This is a Flow variable<br>and it returns a string. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component offers the flexibility benefit of the<br>database query and covers all of the SQL queries possible.<br><br>This component must be used as an output component. It<br>allows you to carry out actions on a table or on the data of a table in<br>a SingleStore database. It also allows you to create a reject flow using a<br>Row &gt; Rejects link to<br>filter data in error. For an example of tMysqlOutput in use, see [Retrieving data in error with a Reject link](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqloutput-tmap-tfileoutputdelimited-tfileinputdelimited-retrieving-data-in-error-with-reject-link-standard-component-this). |
| Dynamic settings | Click the [+] button to add a row in the table<br>and fill the Code field with a context<br>variable to choose your database connection dynamically from multiple<br>connections planned in your Job. This feature is useful when you need to<br>access database tables having the same data structure but in different<br>databases, especially when you are working in an environment where you<br>cannot change your Job settings, for example, when your Job has to be<br>deployed and executed independent of Talend Studio.<br><br>For examples on using dynamic parameters, see [Reading data from databases through<br>context-based dynamic connections](https://help.qlik.com/talend/r/en-US/8.0/components/defining-context-groups/reading-data-from-databases-through-context-based-dynamic-connections) and [Reading data from different MySQL databases<br>using dynamically loaded connection parameters](https://help.qlik.com/talend/r/en-US/8.0/components/context/reading-data-from-different-mysql-databases-using-dynamically-loaded-connection-parameters). For more information on<br>Dynamic settings and context variables, see<br>[Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema) and [Creating a context group and define context<br>variables in it](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/creating-context-group-and-define-context-variables-in-it). |