Database Delete Adaptor
  • 03 Sep 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Database Delete Adaptor

  • Dark
    Light
  • PDF

Article summary

Creating a Database DELETE Adaptor

In order to create a Database Delete Adaptor, you should define a database connection first.

The connection should be selected from the Adaptor Connection dropdown at the top of the screen. The connection can be edited directly via the Pencil icon.

The Database Delete Adaptor allows SQL DELETE statements to be executed. The number of records deleted by the DELETE statement will be put into the output destination schema or public variable location. 

The DELETE Query should be specified as a standard SQL expression. Xponent uses the Python SQL Alchemy library to convert the SQL to the specific dialect of the database type. So, there is no need to use database-specific encoding such as backticks (`identifier`) for MySQL or square brackets ([identifier]) for Microsoft SQL.

It is good practice to develop your query and ensure that it returns the correct data in your usual database development tool before copying it to Xponent and parameterizing.

Final semi-colons are optional. The query can be split over several lines for readability purposes. The query can be parameterized using %%paramName%% anywhere within the query.

For Example: A query to select a customer record could look as follows: 

Anything used in a WHERE clause for a statement should use single or double quotes if the parameter is a string. Suppose the parameter is numeric, as quotation marks are not required. 

Whenever the query is changed, and a parameter is added or removed, it is necessary to save it using the Save Edits button. This will identify all of the parameters and create a slot for this in the Parameters list in the bottom left panel.

Once all of the parameter locations have been specified, the adaptor can be tested - validation will occur automatically before the test. 

If this adaptor executes successfully, then it should populate the schema as follows with the number of deleted rows: 

{
"dbResponse": 1
}

Validation Warnings

: All the invalid notifications will be displayed after expanding the Invalid Drop-down.

WarningNote
Parameter(s) need a data sourceEvery parameter in the query of the form %%param%% must be mapped to an input data source.

Related Pages:


Is it helpful? React and share your comment

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence