Class Insert
Query to insert data.
Inherited Members
Namespace: Terrasoft.Core.DB
Assembly: Terrasoft.Core.dll
Syntax
public class Insert : BaseInsert, IParametrizedQuery, ISqlGenerating, ICacheableQuery, ICloneable, IDBCommand
Constructors
Insert(Insert)
Initializes a new Insert instance that is a clone of the passed-in query.
Declaration
public Insert(Insert source)
Parameters
Type | Name | Description |
---|---|---|
Insert | source | The query to add whose clone is being created. |
Insert(UserConnection)
Initializes a new Insert instance, using the specified user connection.
Declaration
public Insert(UserConnection userConnection)
Parameters
Type | Name | Description |
---|---|---|
UserConnection | userConnection | User connection. |
Properties
ColumnValues
A collection of query column values.
Declaration
public ModifyQueryColumnValueCollection ColumnValues { get; }
Property Value
Type | Description |
---|---|
ModifyQueryColumnValueCollection |
ColumnValuesCollection
A collection of query column values for a batch query.
Declaration
public List<ModifyQueryColumnValueCollection> ColumnValuesCollection { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<ModifyQueryColumnValueCollection> |
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 Insert instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new Insert 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
Into(String)
Adds an INTO clause to the current query that specifies the schema with the given name as the data source for the query.
Declaration
public Insert Into(string schemaName)
Parameters
Type | Name | Description |
---|---|---|
System.String | schemaName | Name of the schema. |
Returns
Type | Description |
---|---|
Insert | The current Insert instance. |
Into(ModifyQuerySource)
In the current query, adds the INTO statement that sets the passed-in data source as the query data source.
Declaration
public Insert Into(ModifyQuerySource source)
Parameters
Type | Name | Description |
---|---|---|
ModifyQuerySource | source | Data source. |
Returns
Type | Description |
---|---|
Insert | The current Insert instance. |
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 Insert Set(string sourceColumnAlias, IQueryColumnExpressionConvertible expression)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
IQueryColumnExpressionConvertible | expression | Expression. |
Returns
Type | Description |
---|---|
Insert | The current Insert instance. |
Set(String, Query)
Adds a SET clause to the current query to assign an expression to a column with a specified alias for an arbitrary subquery.
Declaration
public Insert Set(string sourceColumnAlias, Query subSelectQuery)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceColumnAlias | The alias of the column. |
Query | subSelectQuery | Random subquery. |
Returns
Type | Description |
---|---|
Insert | The current Insert 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 Insert 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 |
---|---|
Insert | The current Insert instance. |
Set(String, QueryParameter)
Adds a SET clause to the current query to assign an expression to the column with the specified alias for the passed parameter.
Declaration
public Insert 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 |
---|---|
Insert | The current Insert 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 Insert 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 |
---|---|
Insert | The current Insert instance. |
Values()
Initialize values for batch query.
Declaration
public Insert Values()
Returns
Type | Description |
---|---|
Insert | Current instance of Insert class. |