OracleParameter.SourceColumnNullMapping 属性

定义

获取或设置一个值,该值指示源列是否可以为 null。Gets or sets a value which indicates whether the source column is nullable. 通过此操作,OracleCommandBuilder 能够为可以为 null 的列正确地生成 Update 语句。This allows OracleCommandBuilder to correctly generate Update statements for nullable columns.

public:
 virtual property bool SourceColumnNullMapping { bool get(); void set(bool value); };
public override bool SourceColumnNullMapping { get; set; }
member this.SourceColumnNullMapping : bool with get, set
Public Overrides Property SourceColumnNullMapping As Boolean

属性值

Boolean

true 如果源列可为 null,则为;否则,falsetrue if the source column is nullable; otherwise, false.

注解

当处理可以为 null 的列时,OracleCommandBuilder 使用 SourceColumnNullMapping 来正确生成更新命令。SourceColumnNullMapping is used by the OracleCommandBuilder to correctly generate update commands when dealing with nullable columns. 通常,使用 SourceColumnNullMapping 仅限于从 OracleCommandBuilder继承的开发人员。Generally, use of SourceColumnNullMapping is limited to developers inheriting from OracleCommandBuilder.

DbCommandBuilder 使用此属性来确定源列是否可以为 null,并将此属性设置为可以为 null 的情况下 true false,如果不是,则设置为。DbCommandBuilder uses this property to determine whether the source column is nullable, and sets this property to true if it is nullable, and false if it is not. OracleCommandBuilder 生成其 Update 语句时,它会检查每个参数的 SourceColumnNullMappingWhen OracleCommandBuilder is generating its Update statement, it examines the SourceColumnNullMapping for each parameter. 如果该属性 trueOracleCommandBuilder 将生成如下 WHERE 子句(在此查询表达式中,"FieldName" 表示字段的名称):If the property is true, OracleCommandBuilder generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field):

((@IsNull_FieldName = 1 AND FieldName IS NULL) OR   
  (FieldName = @Original_FieldName))  

如果字段 SourceColumnNullMapping 为 false,则 OracleCommandBuilder 生成以下 WHERE 子句:If SourceColumnNullMapping for the field is false, OracleCommandBuilder generates the following WHERE clause:

FieldName = @OriginalFieldName  

此外,如果源字段包含 null,则 @IsNull_FieldName 包含1,如果不包含 null,则为0。In addition, @IsNull_FieldName contains 1 if the source field contains null, and 0 if it does not. 此机制允许在 Oracle 服务器中进行性能优化,并提供适用于跨多个提供程序的通用代码。This mechanism allows for a performance optimization in Oracle Server, and provides for common code that works across multiple providers.

适用于