Class Update
Query to update data.
Inherited Members
Namespace: Terrasoft.Core.DB
Assembly: Terrasoft.Core.dll
Syntax
public class Update : Query, IParametrizedQuery, ISqlGenerating, ICacheableQuery, ICloneable, IDBCommand
Constructors
Update(Update)
Initializes a new Update instance that is a clone of the passed-in query.
Declaration
public Update(Update source)
Parameters
Type | Name | Description |
---|---|---|
Update | source | The refresh query whose clone is being created. |
Update(UserConnection)
Initializes a new Update instance, using the specified user connection.
Declaration
public Update(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Update(UserConnection, String)
Initializes a new Update instance for the schema with the specified name using the specified user connection.
Declaration
public Update(UserConnection userConnection, string schemaName)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
System.String | schemaName | Name of the schema. |
Update(UserConnection, ModifyQuerySource)
Initializes a new Update instance for the specified data source using the specified user connection.
Declaration
public Update(UserConnection userConnection, ModifyQuerySource source)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
ModifyQuerySource | source | Data source. |
Properties
ColumnValues
Collection of values of the query columns.
Declaration
public ModifyQueryColumnValueCollection ColumnValues { get; }
Property Value
Type | Description |
---|---|
ModifyQueryColumnValueCollection |
Source
The query data source.
Declaration
public ModifyQuerySource Source { get; set; }
Property Value
Type | Description |
---|---|
ModifyQuerySource |
Methods
BuildSqlText(StringBuilder)
Generates the query text, using the specified System.Text.StringBuilder instance.
Declaration
public override void BuildSqlText(StringBuilder sb)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | sb | The System.Text.StringBuilder instance used to create query text. |
Overrides
Clone()
Creates the clone of the current Update instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new Update instance that is a clone of the current instance. |
Overrides
GetSqlText()
Returns the SQL text of the current query.
Declaration
public override string GetSqlText()
Returns
Type | Description |
---|---|
System.String | The SQL text of the current query. |
Overrides
GetUsingParameters()
Gets the collection of the query parameters.
Declaration
public override QueryParameterCollection GetUsingParameters()
Returns
Type | Description |
---|---|
QueryParameterCollection | Collection of the query parameters. |
Overrides
Set(String, IQueryColumnExpressionConvertible)
Adds a SET clause to the current query to assign to the column with the specified alias the passed expression.
Declaration
public Update Set(string sourceColumnAlias, IQueryColumnExpressionConvertible expression)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
IQueryColumnExpressionConvertible | expression | Expression. |
Returns
Type | Description |
---|---|
Update | The current Update instance. |
Set(String, Query)
Adds a SET clause to the current query to assign an expression to a column with a specified alias for a passed arbitrary subquery.
Declaration
public Update Set(string sourceColumnAlias, Query subSelectQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
Query | subSelectQuery | Random subquery. |
Returns
Type | Description |
---|---|
Update | The current Update instance. |
Set(String, QueryColumnExpression)
Adds a SET clause to the current query to assign to the column with the specified alias the passed column expression.
Declaration
public Update Set(string sourceColumnAlias, QueryColumnExpression columnExpression)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
QueryColumnExpression | columnExpression | The column expression. |
Returns
Type | Description |
---|---|
Update | The current Update instance. |
Set(String, QueryParameter)
Adds a SET clause to the current query to assign to the column with the specified alias the passed parameter.
Declaration
public Update Set(string sourceColumnAlias, QueryParameter parameter)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
QueryParameter | parameter | The query parameter. |
Returns
Type | Description |
---|---|
Update | The current Update instance. |
Set(String, Select)
In the current query, adds the SET statement that assigns the expression for the passed-in select subquery to the column with the specified alias.
Declaration
public Update Set(string sourceColumnAlias, Select subSelect)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
Select | subSelect | The select subquery |
Returns
Type | Description |
---|---|
Update | The current Update instance. |