The Delete class
Glossary Item Box
Introduction
The Terrasoft.Core.DB.Delete class is used to build queries for deleting records in Creatio database tables. As a result of creating and configuring the instance of this class, the DELETE SQL-expression query to the application database will be built.
The “Terrasoft.Core.DB.Delete” class
Use the “.NET class libraries of platform core” documentation to access the full list of the methods, properties, parent classes, and implemented interfaces of the Delete class.
Constructors
- public Delete((UserConnection userConnection))
-
Creates a class instance using UserConnection.
- public Delete((Delete source))
-
Creates a class instance that is a clone of the instance passed as an argument.
Properties
Table 1. Primary properties of the class
- UserConnection
- Terrasoft.Core.UserConnection
-
The current user connection at the moment of executing the query.
- Condition
- Terrasoft.Core.DB.QueryCondition
-
Condition of Where expression in the query.
- HasCondition
- bool
-
Determines whether Where expression is available in the query.
- Source.
- Terrasoft.Core.DB.ModifyQuerySource
-
The query data source.
Methods
Table 2. Primary methods of the class
- string GetSqlText(())
-
Returns the SQL text of the current query.
- void BuildSqlText((StringBuilder sb))
-
Generates the query text via the StringBuilder instance.
- void ResetCachedSqlText(())
-
Clears the cached text of the query.
- QueryParameterCollection GetUsingParameters(())
-
Returns the collection of parameters used by the query.
- int Execute(())
-
Executes the query. Returns the number of records involved by the query.
- int Execute((DBExecutor dbExecutor))
-
Executes the query using the DBExecutor instance. Returns the number of records involved by the query.
- 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 – an alias of the column for which the condition is added;
- sourceAlias – the alias of the source;
- subSelect – a subquery of the data selection, for whose results the condition is added;
- subSelectQuery – the subquery, for whose results the condition is added;
- columnExpression – the expression, for whose results the condition is added;
- 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 – an alias of the column, for which the predicate is added;
- sourceAlias – the alias of the source;
- subSelect – the data selection subquery used as a predicate;
- subSelectQuery – the subquery used as a predicate;
- parameter – parameter that the predicate is added to;
- columnExpression – the expression used 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 – an alias of the column, for which the predicate is added;
- sourceAlias – the alias of the source;
- subSelect – the data selection subquery used as a predicate;
- subSelectQuery – the subquery used as a predicate;
- parameter – parameter that the predicate is added to;
- columnExpression – the expression used 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 – schema name (tables, views);
- source – the data source.
See also