SAP HANA - Update
On this page
Snap type: | Write | |||||||
---|---|---|---|---|---|---|---|---|
Description: | This Snap executes an SQL update with the given properties. Keys from the document will be used as the columns to update and their values will be the updated value in the column. Updates will be batched up until the account's batch size property or until the structure of the update statement changes. An update statement will change if an incoming document contains different keys than a previous document. Expected upstream Snaps: The data to be updated in the table can be defined by providing values upstream. The document generator Snaps like JSON Generator can be used in upstream. | |||||||
Prerequisites: | [None] | |||||||
Support and limitations: | Works in Ultra Task Pipelines. | |||||||
Account: | This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. See Configuring SAP HANA Accounts for information on setting up this type of account. | |||||||
Views: |
| |||||||
Settings | ||||||||
Label | Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline | |||||||
Schema name | The database schema name. In case it is not defined, then the suggestion for the table name will retrieve all tables names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values. The values can be passed using the pipeline parameters but not the upstream parameter. Example: myschema Default value: [None] | |||||||
Table name | Required. The name of the table to execute the update operation on. The values can be passed using the pipeline parameters but not the upstream parameter. Example: people Default value: [None] | |||||||
Update condition | Specify the SQL WHERE clause of the update statement. You can define specific values or columns to update (Set condition) in the upstream Snap, such as Mapper Snap, and then use the WHERE clause to apply these conditions on the columns sourced from the upstream Snap. For instance, here is a sample of an Update SQL query:
If the Update Condition field is left blank, the condition is applied on all the records of the target table. In certain scenarios where you want to use specific data from the upstream Snaps, and do not want to change that data in the Update Snap, then you need to place the data in the
Instead of building multiple Snaps with inter dependent DML queries, it is recommended to use the SAP HANA - Stored Procedure Snap. Refer to the example to understand how to use the Update Condition. Examples: Without using expressions
Using expressions
Caution Using expressions that join strings together to create SQL queries or conditions has a potential SQL injection risk and is hence unsafe. Ensure that you understand all implications and risks involved before using concatenation of strings with '=' Expression enabled. Default value: [None] | |||||||
Number of retries | Specifies the maximum number of attempts to be made to receive a response. The request is terminated if the attempts do not result in a response. Example: 3 Default value: 0
| |||||||
Retry interval (seconds) | Specifies the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception. Example: 10 Default value: 1 | |||||||
Snap execution | Select one of the three modes in which the Snap executes. Available options are:
|
In a scenario where the Auto commit on the account is set to true, and the downstream Snap does depends on the data processed on an Upstream Database Bulk Load Snap, use the Script Snap to add delay for the data to be available.
For example, when performing a create, insert and a delete function sequentially on a pipeline, using a Script Snap helps in creating a delay between the insert and delete function or otherwise it may turn out that the delete function is triggered even before inserting the records on the table.
Examples
The following example updates the city of users in the "USER" table based on the update condition (age < 55).
The update values are passed from upstream using JSON Generator. The update condition here will specify the condition to identify the records to be updated.
The sample output of update Snap looks like:
Snap Pack History
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.