Class DB2DmlService
- Namespace
- LinqToDB.Internal.DataProvider.DB2
- Assembly
- linq2db.dll
DB2 DML mechanics. Identity retrieval is version-specific: LUW wraps a with-identity insert as
SELECT <id> FROM NEW TABLE (INSERT …) (one scalar command, emitted by the builder), or — when no
identity field is detected — falls back to the insert plus SELECT identity_val_local(); z/OS appends
; SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1 to the insert (builder BuildGetIdentity).
A truncate-with-reset becomes the truncate plus one SqlRawStatement per
identity column (ALTER TABLE … ALTER … RESTART WITH 1). Everything else uses the base scenario.
public abstract class DB2DmlService : DmlServiceBase, IDmlService
- Inheritance
-
objectDB2DmlService
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
Version
protected abstract DB2Version Version { get; }
Property Value
Methods
BuildCommandScenario(SqlStatement, SqlProviderFlags, ISqlExpressionFactory)
Builds the command scenario for statement. The base handles the InsertOrReplace / Upsert
emulation and otherwise returns a single-step DefaultScenario(SqlStatement) (one statement, one command).
Providers override to build an explicit multi-step scenario (identity retrieval, per-field truncate reset,
etc.), using factory to construct any synthetic statements (e.g. an identity SELECT),
and delegate the default case back here via base.BuildCommandScenario(...).
public override SqlCommandScenario? BuildCommandScenario(SqlStatement statement, SqlProviderFlags flags, ISqlExpressionFactory factory)
Parameters
statementSqlStatementflagsSqlProviderFlagsfactoryISqlExpressionFactory
Returns
IsTableNotFoundExceptionCore(Exception)
Detects a provider-specific "table not found" exception. Called for every link of the inner-exception chain.
protected override bool IsTableNotFoundExceptionCore(Exception exception)
Parameters
exceptionException