Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this Page

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

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:


InputThis Snap has exactly one input view.
OutputThis Snap has at most one output view. If an output view is available, then the original document that was used to create the statement will be output with the status of the update.
ErrorThis Snap has at most one error view and produces zero or more documents in the view.


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.

Note

The values can be passed using the pipeline parameters but not the upstream parameter.

ExampleSYS

Default value: [None]


Table name


Table name to execute the update on.

Note

The values can be passed using the pipeline parameters but not the upstream parameter.

Exampleusers

Default value: [None]  


Where Condition


Where condition of the upsert statement.  

Note

Instead of building multiple Snaps with inter dependent DML queries, it is recommended to use the Stored Procedure or the Multi Execute Snap.
In a scenario where 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.

Default value: [None]


With primary key?


The 'With Primary Key' clause is appended to the UPSERT statementUPSERT statement. See UPSERT Statement  https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.04/en-US/ea8b6773be584203bcd99da76844c5ed.html?q=upsert for detailsfor details.

Note
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

Multiexcerpt include macro
nameretries
pageFile Reader

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

Multiexcerpt include macro
nameSnap Execution
pageSOAP Execute

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

Insert excerpt
Azure SQL - Bulk Load
Azure SQL - Bulk Load
nopaneltrue

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

Insert excerpt
SAP HANA Snap Pack
SAP HANA Snap Pack
nopaneltrue