Google Cloud SQL Insert

Use this activity to execute an SQL Insert statement on a Google cloud database instance. The Google Cloud SQL Insert activity returns information in the form of rows based on the returning clause specified.

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.

Input Settings

The Input Settings tab has the following fields:

Field Description
Query You can construct prepared SQL queries by using substitution variables (or parameters) of the form ?<fieldname> in the insert query statement.

Each substitution variable identifies an input parameter whose mapped value will be substituted into the substitution variable at runtime. You can reuse the substitution variable for the same input parameter elsewhere in the query.

The type information for the input parameters used in the VALUES clause, is fetched from the database using the selected connection for the entered insert query.

Similarly, input fields in the Input tab of the activity are also populated based on the SQL Insert statement.
Note: Be sure to include the semicolon (;) at the end of the query. This activity expects an insert query to end with a semicolon to indicate the end of the query. A missing semicolon at the end of the query results in the query hanging.
The following example represents a typical insert query:
  • INSERT INTO employee (name, salary) VALUES ('test1', ?salary) returning *; 
    For the above insert query, input field is generated for salary (NUMERIC) and name (VARCHAR) under Values[] node as its part of values clause, and it would be under parameters node as it is part of the parameter in the insert query.

    The output tab would have id (INT4), name (VARCHAR) and salary (NUMERIC) as * would return all the columns of inserted row.

  • INSERT INTO products (product_no, name, price) VALUES (? product_no, ?name, ?price) returning price; 
    
    For the above insert query, output field is generated for price and input fields are generated for product_no (INTEGER), name(TEXT), and price(NUMERIC).

    The mapped value for the field product_no, name, price is substituted into the substitution variables ?product_no, ? name, ?price.

    The parameters node in the Input tab will not have mappings as there is no parameter in the insert query statement.
Fields The grid is provided for informational purpose only.

Input

This tab displays the input schema of the activity in a tree structure format. The information in the schema varies based on the insert query provided. The fields that were selected in the Input Settings tab will be 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.

Fields from RETURNING clause are displayed under the Parameter node and the fields from VALUES clause are displayed under the VALUES node in the input schema.

Output

This tab displays the activity output schema in a tree structure format. The output of an activity is displayed for informational purposes only and cannot be modified or altered. The information in this schema varies depending on the fields that are selected in the Input Settings tab. 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.