SAP HANA - Upsert
On this Page
Snap type: | Read | |||||||
---|---|---|---|---|---|---|---|---|
Description: | This Snap executes a SAP HANA Upsert with the given properties. The documents that are provided on the input view will be either inserted or updated into the provided table on the provided database. Expected upstream Snaps: The columns of the selected table need to be mapped upstream using a Mapper Snap. The Mapper Snap will provide the target schema, which reflects the schema of the table that is selected for the Upsert Snap. Expected downstream Snaps: The Snap will output one document for every record inserted or updated, hence any document processing Snap can be used downstream. Expected input: Document that conforms to the input view schema of the Snap. The input view schema is provided to an upstream Mapper Snap, based on the selected service object. Expected output: Document which represents the status of the upsert operation for that document. Each upsert operation is represented as one document in the output view. | |||||||
Prerequisites: | [None] | |||||||
Support and limitations: | Works in Ultra 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: SYS Default value: [None] | |||||||
Table name | Table name to execute the update on. The values can be passed using the pipeline parameters but not the upstream parameter. Example: users Default value: [None] | |||||||
Where Condition | Where condition of the upsert statement. Instead of building multiple Snaps with inter dependent DML queries, it is recommended to use the Stored Procedure or the Multi Execute Snap. Default value: [None] | |||||||
With primary key? | The 'With Primary Key' clause is appended to the UPSERT statement. See UPSERT Statement for details. The 'Where condition' property and 'With primary key' property can not be combined together. If you enter 'Where condition', then 'With primary key?' property value is ignored. Default value: Not selected | |||||||
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 | Page lookup error: page "Anaplan Read" not found. If you're experiencing issues please see our Troubleshooting Guide. |
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.
Example
The following example illustrates the usage of Upsert Snap. In this example we will supply two documents from upstream having customer information. We will try to upsert this data into table called 'K_CUSTOMER'.
Following is the sample pipeline:
Input data is passed using JSON Generator Snap. Following is the sample data passed.
The where condition is applied on field 'customername' of customer1 table. Once the Upsert Snap execution completes, the record with customername 'John' updates and a new record is created for customer 'Shaun'.
The sample output looks as shown below:
See Also
Snap Pack History
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.