Delete from ext. database
Function: Delete from external database
This function allows you to remove one or more records from a table in an external database that is connected to your platform. You can choose to delete all records or specify conditions to remove only certain ones.
Input
- Database connection: Your pre-configured link to the external database (e.g., a connection to your MySQL, PostgreSQL, or SQL Server database).
- Table Name: The exact name of the table in your external database from which you want to remove records (e.g.,
Customers,Orders,Products). - Data Structure: The blueprint (schema) in your platform that matches the structure of the table you're deleting from. This helps the platform understand the table's columns and their types.
- Filters (Optional): A set of conditions that determine which specific records to delete. If no filters are provided, all records in the specified table will be deleted.
- Attribute: A specific column from your selected Data Structure (e.g.,
Product ID,Order Date,Status). - Operator: How you want to compare the attribute's value.
EqualGreater thanGreater than or equalInLess thanLess than or equalNot equalNot inContainsContains \(ignore case\)Starts withEnds with
- Value: The specific data you want to compare against the attribute (e.g.,
123,2023-01-01,Pending).
- Attribute: A specific column from your selected Data Structure (e.g.,
Output
This function does not return any direct output. Its primary effect is the modification (deletion of records) within your external database.
Execution Flow
Real-Life Examples
Example 1: Deleting all "Pending" orders
Scenario: You want to clean up your Orders table by removing all orders that are still marked as "Pending" after a certain period.
Inputs:
- Database connection:
MyCompany_CRM_DB - Table Name:
Orders - Data Structure:
Order_Schema(matching theOrderstable) - Filters:
- Attribute:
Status - Operator:
Equal - Value:
Pending
- Attribute:
Result: All records in the Orders table where the Status column is "Pending" will be permanently removed from your external database.
Example 2: Removing old customer data for privacy compliance
Scenario: To comply with data retention policies, you need to delete customer records where the Last Activity Date is older than two years.
Inputs:
- Database connection:
Customer_Data_Warehouse - Table Name:
Customers - Data Structure:
Customer_Profile_Schema - Filters:
- Attribute:
Last Activity Date - Operator:
Less than - Value:
2022-01-01(assuming today is after 2024-01-01)
- Attribute:
Result: All customer records in the Customers table with a Last Activity Date before January 1, 2022, will be deleted from your external database.
Example 3: Deleting specific product entries by ID
Scenario: A batch of products was recalled, and you need to remove their entries from your Products table using a list of product IDs.
Inputs:
- Database connection:
Product_Catalog_DB - Table Name:
Products - Data Structure:
Product_Details_Schema - Filters:
- Attribute:
Product ID - Operator:
In - Value:
[1001, 1005, 1012, 1020](a list of specific product IDs)
- Attribute:
Result: The product records corresponding to Product ID 1001, 1005, 1012, and 1020 will be removed from the Products table in your external database.