Show / Hide Table of Contents

Class Insert

Class representing the SQL INSERT Statement

Inheritance
Object
SqlCommand
PrivateSave
Insert
Implements
ISoDataLookup
ISentryIgnorable
ICloneable
Inherited Members
PrivateSave.GetTableInfos()
PrivateSave.CloneToBasicUpdatingQuery()
PrivateSave.GetKnownFields()
PrivateSave.GetFieldValue(FieldInfo)
PrivateSave.GetPersistedFieldValue(FieldInfo)
PrivateSave.IsPersistedFieldValueKnown(FieldInfo)
PrivateSave.IsGhostField(FieldInfo)
PrivateSave.BeginIgnoreSentryCheck()
PrivateSave.EndIgnoreSentryCheck()
PrivateSave.IsSentryIgnored
PrivateSave.OnUpdateField
SqlCommand.Origin
SqlCommand.AddIgnoreAutoSentryTableInfo(TableInfo)
SqlCommand.AddIgnoreAutoSentryTableInfo(IEnumerable<TableInfo>)
SqlCommand.RemoveIgnoreAutoSentryTableInfo(TableInfo)
SqlCommand.ClearIgnoreAutoSentryTableInfos()
SqlCommand.IsAutoSentryIgnoredOnTableInfo(TableInfo)
SqlCommand.GetPrivateSaves()
SqlCommand.GetInserts()
SqlCommand.GetUpdates()
SqlCommand.GetDeletes()
SqlCommand.GetSelect()
SqlCommand.AutoSentryIgnoredTables
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public sealed class Insert : PrivateSave, ISoDataLookup, ISentryIgnorable, ICloneable

Properties

FieldValuePairs

The returned fields from the SELECT statement.

Declaration
public ArgumentParameterCollection FieldValuePairs { get; set; }
Property Value
Type Description
ArgumentParameterCollection

InnerFieldValuePairs

Returns the current ArgumentParameterCollection. Throws a SoException if the collection is null or contains no elements.

Declaration
protected override ArgumentParameterCollection InnerFieldValuePairs { get; }
Property Value
Type Description
ArgumentParameterCollection
Overrides
PrivateSave.InnerFieldValuePairs

InnerPrimaryKey

Overridden primary key for the sql-command.

Declaration
protected override FieldInfo InnerPrimaryKey { get; }
Property Value
Type Description
FieldInfo
Overrides
PrivateSave.InnerPrimaryKey
Remarks

There is no explicit primary key in an Insert-statement, however one of the arguments has to be the primary key field for the insert to be meaningful. This property therefore looks up the primary key field in the argument collection, and will return that field. You will get an exception if the argument collection does not currently contain the primary key field (as specified in the dictionary definition of the table).

InnerPrimaryKeyValue

Overridden primary key value for the sql-command.

Declaration
protected override Parameter InnerPrimaryKeyValue { get; }
Property Value
Type Description
Parameter
Overrides
PrivateSave.InnerPrimaryKeyValue
Remarks

There is no explicit primary key in an Insert-statement, however one of the arguments has to be the primary key field for the insert to be meaningful. This property therefore looks up the primary key field in the argument collection, and will return that field. You will get an exception if the argument collection does not currently contain the primary key field (as specified in the dictionary definition of the table).

SqlType

Returns SqlType.IsInsert.

Declaration
public override SqlType SqlType { get; }
Property Value
Type Description
SqlType
Overrides
SqlCommand.SqlType

Methods

Clone()

Cloning function that returns a hybrid deep/shallow copy

Declaration
public object Clone()
Returns
Type Description
Object

Hybrid deep/shallow copy

Remarks

This cloning function uses the Clone() function and is subject to the same assumptions and limitations. TableInfo/FieldInfo objects are not deep copied, and you do not get copies of the values of BLOB object parameters.

SetPrimaryKeyValue(Parameter)

Will set the value for the primary key. Will throw an exception if the value isn't an integer.

Declaration
public void SetPrimaryKeyValue(Parameter primaryValue)
Parameters
Type Name Description
Parameter primaryValue

The value, represented as a Parameter.

Remarks

Since this method is based on the InnerPrimaryKey method here, it requires the primary key field to be ALREADY DEFINED in the Insert query.

ToString()

String output.

Declaration
public override string ToString()
Returns
Type Description
String

INSERT (....) INTO ...

Overrides
Object.ToString()

Implements

ISoDataLookup
ISentryIgnorable
System.ICloneable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
QueryExectionExtensions.ExecuteReader(SqlCommand, Boolean)
QueryExectionExtensions.ExecuteScalar<T>(SqlCommand)
QueryExectionExtensions.ExecuteNonQuery(SqlCommand)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top