Delete

Deletes records in a Relational Database.

Usage

You can view the list of supported databases and how to configure them in the Project Editor documentation. There is a separate Delete Node in the Node Selector for each database technology supported in Sanbox.

Configuring a Delete Node

The Delete Node allows you to delete one or more records in a relational database. The Data conduit refers to data that will be used to delete records. See the examples below for different data formats supported. All records with the primary key(s) found will be deleted.

Data passed in Data Conduit:

Consider the following create table script for the Customers table showing us its structure.

CREATE TABLE [dbo].[Customers](
[CustomerID] [nchar](5) NOT NULL,
[CompanyName] [nvarchar](40) NOT NULL,
[ContactName] [nvarchar](30) NULL,
[ContactTitle] [nvarchar](30) NULL,
[Address] [nvarchar](60) NULL,
[City] [nvarchar](15) NULL,
[Region] [nvarchar](15) NULL,
[PostalCode] [nvarchar](10) NULL,
[Country] [nvarchar](15) NULL,
[Phone] [nvarchar](24) NULL,
[Fax] [nvarchar](24) NULL,
CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED
(
[CustomerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

Array of Values

If your table has only one primary key (like in this case), all that is required for input to the Delete Node is an array of values, or a single value for what records to delete by primary key:

[
"TRAIH",
"SPLIR",
"SIMOB"
]

Deletes customers found by CustomerID TRAIH, SPLIR, and SIMOB.

Array of Objects

If you don't have an array of values on hand, or if your table has more than one primary key, you can pass an array of objects with each object containing the primary key(s) as propertie(s):

[
{
"CustomerID": "TRAIH"
},
{
"CustomerID": "SPLIR",
"CompanyName": "Split Rail Beer & Ale"
},
{
"CustomerID": "SIMOB",
"ExtraPropertyDoesntMatter": 12
}
]

Deletes customers found by CustomerID TRAIH, SPLIR, and SIMOB.

Single Object / Value

You can also pass a single value like the string TRAIH to delete just one record, or pass a single object with the primary key(s) propertie(s).