# tSnowflakeRow

Executes the SQL command stated onto a specified Snowflake database.

Information noteNote:

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## tSnowflakeRow Standard properties

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

The Standard tSnowflakeRow component belongs to the Cloud family.

Information noteNote: This component is a specific version of a dynamic database connector. The properties related to database settings vary depending on your database type selection. For more information about dynamic database connectors, see [DB Generic components](https://help.qlik.com/talend/r/en-US/8.0/components/db-generic/db-generic-component).

## 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. |
| Component list | Select the component that opens the database connection to be reused by this<br>component. |
| Account | In the Account field, enter, in double<br>quotation marks, the account name that has been assigned to you by Snowflake. |
| Authentication Type | Set the authentication type.<br><br><ul> <li> <p> <span>Basic</span>: Select this option if key pair                           authentication is not enabled. </p> </li> <li> <p> <span>Key Pair</span>: Select this option if key pair                           authentication is enabled.</p> <p>See <a href="https://docs.snowflake.net/manuals/user-guide/jdbc-configure.html#using-key-pair-authentication" target="_blank">Using Key Pair Authentication</a> for related                           information.</p> </li> <li> <p> <span>OAuth 2.0</span>: Select this option to use external                           OAuth for data accessing.</p> <p>See <a href="https://docs.snowflake.com/en/user-guide/oauth-ext-overview.html" target="_blank">External OAuth Overview</a> for related                           information.</p> </li> </ul><br><br>Information noteNote: Before selecting the Key<br>Pair option, make sure you have set the key pair authentication<br>data in the Basic settings view of the tSetKeystore<br>component as follows.<br><br><ol> <li>Leave the <span>TrustStore type</span> field unchanged.</li> <li>Set <span>TrustStore file</span> to                           <kbd>""</kbd>.</li> <li>Clear the <span>TrustStore password</span> field.</li> <li>Select <span>Need Client authentication</span>.</li> <li>Enter the path to the key store file in double quotation marks in the                              <span>KeyStore file</span> field (or click the                              <span>[…]</span> button to the right of the                              <span>KeyStore file</span> field and navigate to the key                           store file).</li> <li>Enter the key store file password in the <span>KeyStore                              password</span> field.</li> <li>Clear the <span>Check server identity</span> option.</li> </ol> |
| OAuth token endpoint | Enter OAuth 2.0 token endpoint.<br><br>This option is available when<br>OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| Client ID | Enter the client ID of your application.<br><br>This option is available when<br>OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| Client Secret | Enter the client secret of your application.<br><br>This option is available when<br>OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| Grant type | Set the grant type for retrieving the access token. Two options are<br>provided: Client Credentials and<br>Password.<br><br>Click [Client Credentials](https://tools.ietf.org/html/rfc6749#section-1.3.4) and [Resource Owner Password Credentials](https://tools.ietf.org/html/rfc6749#section-1.3.3) for related<br>information.<br><br>This option is available when OAuth<br>2.0 is selected from the Authentication<br>Type dropdown list. |
| OAuth username | Enter the OAuth username.<br><br>This option is available when<br>Password is selected from the Grant<br>type dropdown list. |
| OAuth password | Enter the OAuth password.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password between double quotes in the<br>pop-up dialog box, and then click OK to save the<br>settings.<br><br>This option is available when Password<br>is selected from the Grant type dropdown<br>list.<br><br>Information noteNote: OAuth password does not support spaces. |
| Scope | Enter the scope. See [Scopes](https://docs.snowflake.com/en/user-guide/oauth-ext-overview.html#scopes) for related information.<br><br>This option is<br>available when OAuth 2.0 is selected from the<br>Authentication Type dropdown list. |
| User Id and Password | Enter, in double quotation marks, your authentication information to<br>log in to Snowflake.<br><br><ul> <li> <p>In the <span>User ID</span> field, enter, in                        double quotation marks, your login name that has been defined in Snowflake                        using the <em>LOGIN_NAME</em> parameter of                        Snowflake. For details, ask the administrator of your Snowflake                    system.</p> </li> <li> <p>To enter the password, click the <span>[...]</span> button         next to the password field, enter the password in double quotes in the pop-up dialog box,         and click <span>OK</span> to save the settings.</p> </li> </ul> |
| Warehouse | Enter, in double quotation marks, the name of the<br>Snowflake warehouse to be used. This name is case-sensitive and is normally upper<br>case in Snowflake. |
| Schema | Enter,<br>within double quotation marks, the name of the database schema to be used. This name<br>is case-sensitive and is normally upper case in Snowflake. |
| Database | Enter, in double quotation<br>marks, the name of the Snowflake database to be used. This name is case-sensitive<br>and is normally upper case in Snowflake. |
| Table | Click the [...] button and in the displayed wizard, select the<br>Snowflake table to be used. |
| 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><br>Built-In: You create and store the schema locally for this component<br>only.<br><br><br>Repository: You have already created the schema and stored it in the<br>Repository. You can reuse it in various projects and Job designs.<br><br>If the Snowflake data type to be handled is VARIANT, OBJECT, or ARRAY, while<br>defining the schema in the component, select String for the<br>corresponding data in the Type column of the schema editor<br>wizard.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<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><br><br>This component offers the advantage of the<br>dynamic schema feature. This allows you to retrieve unknown columns from source<br>files or to copy batches of columns from a source without mapping each column<br>individually. For further information about dynamic schemas, see [Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema).<br><br>This<br>dynamic schema feature is designed for the purpose of retrieving unknown columns of a<br>table and is recommended to be used for this purpose only; it is not recommended for the<br>use of creating tables. |
| Guess Query | Click the button to generate the query which corresponds to the table and the schema in the Query field. |
| Query | Specify the SQL command to be executed.<br><br>For more information about Snowflake SQL commands, see [SQL Command Reference](https://docs.snowflake.net/manuals/sql-reference-commands.html). |
| 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. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Additional JDBC Parameters | Specify additional connection properties for the database connection you are<br>creating. The properties are separated by semicolon and each property is a key-value<br>pair, for example, *encryption=1;clientname=Talend*.<br><br>This field is available only when you select Use<br>this Component from the Connection Component<br>dropdown list and select Internal from the<br>Storage dropdown list in the Basic<br>settings view. |
| Login Timeout | Specify the timeout period (in minutes)<br>of Snowflake login attempts. An error will be generated if no response is received<br>in this period. |
| Role | Enter, in<br>double quotation marks, the default access control role to use to initiate the<br>Snowflake session.<br><br>This role must already exist and<br>has been granted to the user ID you are using to connect to Snowflake. If this field<br>is left empty, the PUBLIC role is automatically granted. For information about<br>Snowflake access control model, see [Understanding the Access Control<br>Model](https://docs.snowflake.net/manuals/user-guide/security-access-control.html). |
| URL suffix | Enter, in double quotation marks, the Snowflake custom domain URL of your<br>choice. For more information about Snowflake URL formats, see [Standard account URLs](https://docs.snowflake.com/en/user-guide/organizations-connect#standard-account-urls).<br><br>For Snowflake components other than tSnowflakeConnection, this field is<br>available when you select Use This Component from the<br>Connection Component drop-down list in the<br>Basic settings view. |
| Use PreparedStatement | Select this check box if you want to query the database using a prepared statement. In<br>the Set PreparedStatement Parameters table displayed, specify the<br>value for each parameter represented by a question mark ? in the<br>SQL statement defined in the Query field.<br><br><ul> <li> <p> <span>Parameter Index</span>: the position of the parameter in the SQL                statement.</p> </li> <li> <p> <span>Parameter Type</span>: the data type of the parameter.</p> </li> <li> <p> <span>Parameter Value</span>: the value of the parameter.</p> </li> </ul><br><br>For a related use case of this property, see [Using PreparedStatement objects to query data](https://help.qlik.com/talend/en-US/components/8.0/mysql/tmysqlrow-tparserecordset-tfileinputdelimited-tfileoutputdelimited-using-preparedstatement-objects-to-query-data-standard-component-this). |
| Commit every | Specify the number of rows to be processed before committing<br>batches of rows together into the database.<br><br>When used with the tSnowflakeConnection component,<br>tSnowflakeRow ignores the Auto<br>Commit option set in the advanced settings of<br>tSnowflakeConnection and uses this value at runtime<br>instead. |
| Use session timezone | Select this check box to use the time zone of the session instead of the JVM<br>time zone. By default, this option is not selected. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |

## Dynamic settings

| 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). |
| --- | --- |

## Global Variables

| Variables | Description |
| --- | --- |
| NB\_LINE | The number of rows processed. This is an After variable and<br>it returns an integer. |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component offers the flexibility of the database query and covers all<br>possible SQL queries. |

**Related concepts**

* [Writing data into and reading data from a Snowflake table](https://help.qlik.com/talend/en-US/components/8.0/snowflake/tsnowflakeconnection-tsnowflakerow-tsalesforceconnection-writing-data-into-and-reading-data-from-snowflake-table-standard-component "Here is an example of using Talend Snowflake components to connect to Snowflake, create a Snowflake table, write data into the table, then read data from this table, finally close the connection to Snowflake.")