PostgreSQL Delete

Executes a SQL delete statement with the given properties.

Overview

This Snap executes a SQL delete with the given properties.

Prerequisites

A valid PostgreSQL Account with the required permissions.

Snap views

Type Description Examples of upstream and downstream Snaps
Input This Snap has exactly one document input view.
Output This Snap has at most one document output view.
Learn more about Error handling.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Type Description
Label

String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: PostgreSQL - Delete

Example: Delete Employee Records
Schema name

String

The database schema name. Selecting a schema filters the Table name list to show only those tables within the selected schema.
Note: The values can be passed using the pipeline parameters but not the upstream parameter.

Default value: N/A

Table name

String

Required. Table name to execute the delete on.
Note: The values can be passed using the pipeline parameters but not the upstream parameter.

Default value: N/A

Delete condition (deletes all records from table if left blank)

String/Expression

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. Enter in the where clause of the delete statement. Document field values can be substituted into the where clause by providing the path. For example, $person.firstname would insert the field 'firstname' from the 'person' object into the query (firstname == $person.firstname would become firstname == 'Joe' if $person.firstname evaluates to 'Joe').
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: 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: N/A

Number of retries

Integer/Expression

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)

Integer/Expression

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

Dropdown list

Choose one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Execute only

Example: Validate & Execute