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:

Write


Description:

This Snap allows you to execute an SQL delete with the given properties.

If a SELECT query is executed, the query's results are merged into the incoming document and any existing keys will have their values overwritten. On the other hand, the original document is written if there are no results from the query.
 
Expected upstream Snaps:  The dynamic variables used in the execute query can be defined by providing values upstream. The document generator Snaps like JSON Generator can be used upstream. 
Expected downstream Snaps: The Snap will output one document for each execution of Snap with data about number of documents deleted, hence any document processing Snap can be used downstream.

Prerequisites:

[None]

Support and limitations:

Works in Ultra Tasks.

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 document input view. If the input view is defined, then the where clause can substitute incoming values for a given expression.
OutputThis Snap has at most one document 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 delete executed.
Error

This Snap has at most one document error view and produces zero or more documents in the view.

Note
Database Write Snaps output all records of a batch (as configured in your account settings) to the error view if the write fails during batch processing.



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 suggest-able and will retrieve available database schemas during suggest values.

Note

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

Example: myschema

Default value: [None]

Table name


Required. Table name to execute the delete on.

Note

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

Example: people

Default value: [None]

Delete condition

...

Required.

SQL where clause of the delete statement.

Example: email = "customer@gmail.com"

Default value: [None]

Execute during preview

Enables you to execute the Snap during the Save operation so that the output view can produce the preview data.

...

(deletes all records from table if left blank)


This is an expression property to specify the SQL WHERE clause of the delete statement. The delete condition may also be passed via an upstream Snap or through the pipeline parameters.

Note

Specify a valid WHERE clause for the delete condition. If you leave this field blank, the Snap deletes all the records from the table.

Examples

Without using expressions

Using expressions

  • "EMPNO=$EMPNO and ENAME=$EMPNAME"

  • email = $email 

  • emp=$emp

  • "emp='" + $emp + "'"

  • "EMPNO=" + $EMPNO + " and ENAME='" + $EMPNAME+ "'"


Warning
titleCaution

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

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
nameExecution_Detail_Write
pageSOAP Execute

Examples


This example deletes the records from table 'USER'. After the execution of the pipeline all the user records with age 52 are deleted from table.

 

...

Image Added

The delete condition specifies the condition to identify the records to be deleted.

...

Image Added

The sample output of the Snap looks like below:

...


Image Added

Insert excerpt
SAP HANA Snap Pack
SAP HANA Snap Pack
nopaneltrue