Google Cloud SQL Update
Use this activity to execute an update statement on one or more rows of a Google Cloud SQL database instance.
Configuration
The Configuration tab has the following fields:
Field | Description |
---|---|
Connection | Name of the Google Cloud SQL database connection from which to retrieve information. You can select a connection from the drop-down list.
Note: Since Google Cloud SQL Update activity is supported only for MySQL database type, only connections configured with MySQL database are displayed in the drop-down.
|
Input Settings
Field | Description |
---|---|
Query |
An SQL statement is used to update one or more rows in a table. You can construct prepared SQL queries by using substitution parameters of the form ?<fieldname> in the query statement. Each substitution variable identifies an input parameter whose mapped value is substituted at runtime. The type information for the input parameters is fetched from the database using the selected connection for the entered query. Similarly, the input fields in the Input tab of the activity are also populated based on the query. Note: Ensure that a semicolon (;) is added at the end of the query. This
activity expects an update query to end with a semicolon to
indicate the end of the query. The metadata for the tables in the
query is not fetched until the statement is completed with a
semicolon.
The following example represents a typical update query: UPDATE pet SET Name=?Name , Color = ?Color WHERE Species = 'cat'; For the above query, all rows in the 'pet' table have their Name and Colorcolumns are set to the values provided on the Input tab where the species is cat. As usual, all rows satisfying the where clause are updated. If the WHERE clause is omitted then ALL rows are updated. The limit clause can also be used to control this behavior. It is also possible to use a subquery to derive the values to be used in the update. The subquery format follows the general form: UPDATE table_name SET column1 = ?column1, column2 = ?column2...., columnN = ? columnN WHERE [condition]; In this case, the parameters supplied are used in the select query that provides replacement values in the outer update statement. The where clause could also be parameterized. |
Manually Configure Metadata | Set the Manually Configure Metadata field to True to fetch table metadata manually. For more information, see Configuring Metadata of SQL statements manually. |
Table Schema | Displays the metadata of the SQL update statement. This grid is provided for informational purposes only. |
Input
This tab displays the input schema of the activity in a tree structure. The information in the schema varies based on the update query provided. On the Input Settings tab, the fields for which the Parameter columns are checked, are available in the schema. You can either hard code the values or map them to a field from the output of a preceding activity in the flow using the Mapper.
Output
This tab displays the activity output schema in a tree structure. The output of an activity is displayed for informational purposes only and cannot be modified or altered. The Output tab displays rowsAffected, which is equal to the number of rows affected by the query. The properties that are displayed in the Output tab schema correspond to the output of this activity and can be used as input by subsequent activities in the flow.