Class InsertFromSelect
Represents an INSERT INTO / SELECT FROM statement, where all of the return fields in the select part are routed into fields in the INSERT target table. Can only be used for non-replicated targets and does not allocate new primary keys.
Inherited Members
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public class InsertFromSelect : SqlCommand
Properties
GroupBy
The group-by of the data source
Declaration
public GroupBy GroupBy { get; set; }
Property Value
Type | Description |
---|---|
GroupBy |
JoinRestriction
The joins of the data source
Declaration
public JoinRestriction JoinRestriction { get; set; }
Property Value
Type | Description |
---|---|
JoinRestriction |
Restriction
The restriction clause for the data source
Declaration
public Restriction Restriction { get; set; }
Property Value
Type | Description |
---|---|
Restriction |
SqlType
SqlType: Always IsInsertFromSelect
Declaration
public override SqlType SqlType { get; }
Property Value
Type | Description |
---|---|
SqlType |
Overrides
TargetTable
TableInfo that identifies the target table
Declaration
public TableInfo TargetTable { get; set; }
Property Value
Type | Description |
---|---|
TableInfo |
Methods
AddFieldMapping(Argument, FieldInfo)
Add a field mapping. The source can be any valid Argument that can be part of the select; the target must be from the TargetTable tableinfo
Declaration
public void AddFieldMapping(Argument source, FieldInfo target)
Parameters
Type | Name | Description |
---|---|---|
Argument | source | Any Argument that is a valid part of a ReturnFields collection |
FieldInfo | target | A previously non-mapped field in the TargetTable, which must previsouly have been set |
GetTableInfos()
Return the TableInfo objects involved in the source of the statement (the SELECT part)
Declaration
public override TableInfo[] GetTableInfos()
Returns
Type | Description |
---|---|
TableInfo[] |
Overrides
MapCorrespondingFields(TableInfo)
Add field mappings for all fields in the source table that correspond to the target table (name and type match)
Declaration
public void MapCorrespondingFields(TableInfo sourceTable)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | sourceTable | Any TableInfo; will be scanned for fields with the same name and type as in the TargetTable |