Composing delete data queries
Glossary Item Box
The Delete class is used to delete data from the bpm'online database.
The Delete class constructor uses the following objects as parameters:
- User connection (Update (UserConnection)).
- Other object Delete (Delete (Delete)). This will create a copy of an Delete query included in the parameter.
The following are the examples of using the Delete class method used to build queries of varying complexity. In each example a Delete object is created and then an SQL query is provided that will be generated for each different DBMS (MS SQL).
Example 1
var delete = new Delete(userConnection) .From("City"); |
DELETE FROM [dbo].[City]
|
Example 2
var delete = new Delete(userConnection) .From("City") .Where("Id").IsEqual(Column.Parameter("{210299B0-7A24-4C4D-9B6F-658FEFEF2E13}")); |
DELETE FROM [dbo].[City] WHERE [Id] = @P1
|