OracleParameter.SourceColumnNullMapping OracleParameter.SourceColumnNullMapping OracleParameter.SourceColumnNullMapping OracleParameter.SourceColumnNullMapping Property


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

 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


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


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

DbCommandBuilder 使用此属性来确定源列是否可以为 null,并将此属性设置为true是否可以为 null,和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 语句,它将检查SourceColumnNullMapping为每个参数。When 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  

此外,@IsNull_FieldName如果源字段包含 null 值和 0,如果它不包含 1。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.