Skip to main content
Version: 8.0

Delete class

Level: advanced

Terrasoft.Core.DB namespace.

The Terrasoft.Core.DB.Delete class builds queries to delete records from Creatio database tables. As a result of creating and configuring an instance of this class, Creatio will build a DELETE SQL query.

note

View the entire list of methods and properties of the Delete class, its parent classes, as well as the interfaces it implements, in the .NET class library documentation.

Constructors

Delete(UserConnection userConnection)

Creates a class instance using UserConnection.

Delete(Delete source)

Creates a class instance that is a clone of the instance passed as the argument.

Properties

UserConnection Terrasoft.Core.UserConnection

The user connection that the query uses.

Condition Terrasoft.Core.DB.QueryCondition

The Where condition of the query.

HasCondition bool

Whether the query has a Where expression.

Source Terrasoft.Core.DB.ModifyQuerySource

The query data source.

Methods

void ResetCachedSqlText()

Clears the cached query text.

QueryParameterCollection GetUsingParameters()

Returns the parameter collection that the query uses.

int Execute()

Executes the query. Returns the number of records that the query involved.

int Execute(DBExecutor dbExecutor)

Executes the query using the DBExecutor instance. Returns the number of records that the query involved.

QueryCondition Where()
QueryCondition Where(string sourceColumnAlias)
QueryCondition Where(string sourceAlias, string sourceColumnAlias)
QueryCondition Where(Select subSelect)
QueryCondition Where(Query subSelectQuery)
QueryCondition Where(QueryColumnExpression columnExpression)
Query Where(QueryCondition condition)

Adds the initial condition to the current query.

Parameters

sourceColumnAlias

The alias of the schema to which to add the condition.

sourceAlias

The alias of the source.

subSelect

The data selection subquery to whose results to add the condition.

subSelectQuery

The subquery to whose results to add the condition.

columnExpression

The expression to whose results to add the condition.

condition

The query condition.

QueryCondition And()
QueryCondition And(string sourceColumnAlias)
QueryCondition And(string sourceAlias, string sourceColumnAlias)
QueryCondition And(Select subSelect)
QueryCondition And(Query subSelectQuery)
QueryCondition And(QueryParameter parameter)
QueryCondition And(QueryColumnExpression columnExpression)
Query And(QueryCondition condition)

Adds the condition (predicate) to the current query condition using the AND logical operation.

Parameters

sourceColumnAlias

The name of the schema to which to add the predicate.

sourceAlias

The alias of the source.

subSelect

The data selection subquery that serves as a predicate.

subSelectQuery

The subquery that serves as a predicate

parameter

The parameter to which to add the predicate.

columnExpression

The expression that serves as a predicate.

condition

The query condition.

QueryCondition Or()
QueryCondition Or(string sourceColumnAlias)
QueryCondition Or(string sourceAlias, string sourceColumnAlias)
QueryCondition Or(Select subSelect)
QueryCondition Or(Query subSelectQuery)
QueryCondition Or(QueryParameter parameter)
QueryCondition Or(QueryColumnExpression columnExpression)
Query Or(QueryCondition condition)

Adds the condition (predicate) to the current query condition using the OR logical operation.

Parameters

sourceColumnAlias

The name of the schema to which to add the predicate.

sourceAlias

The alias of the source.

subSelect

The data select subquery that serves as a predicate.

subSelectQuery

The subquery that serves as a predicate

parameter

The parameter to which to add the predicate.

columnExpression

The expression that serves as a predicate.

condition

The query condition.

Delete From(string schemaName)
Delete From(ModifyQuerySource source)

Adds the data source to the current query. Returns the current Delete instance.

Parameters

schemaName

The schema name (tables, views).

source

The data source.