DB2®Connection.EnableExtendedIndicators Property
Enables the use of default and unassigned indicators as parameters.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
Public Overrides Property EnableExtendedIndicators As Boolean
[C#]
public override bool EnableExtendedIndicators { get; set; }
[C++]
public:
virtual property bool EnableExtendedIndicators {
bool get () override;
void set (bool value) override;
}
Property value
A boolean value that determines
whether extended indicators are to be enabled. If the value is true
,
extended indicators are enabled; if the value isfalse
,
extended indicators are not enabled. The default value is false
.
Remarks
Enabling extended indicators requires extra processing. Enable them only if the parameters that you are passing are indicated as a default or unspecified value.
Assume that you have the following table definition:
CREATE TABLE T1 ( C1 INT WITH DEFAULT 100, C2 INT, C3 VARCHAR(6) )
The
following example shows a named parameter that uses a default indicator:
[Visual Basic]
[C#]
DB2Connection myConn = new DB2Connection(myConnString);
myConn.EnableExtendedIndicators = true;
DB2Command myCmd = conn.CreateCommand();
myCmd.CommandText = "INSERT INTO T1 VALUES(@p1, @p2, @p3)";
myCmd.Parameters.Add( new DB2Parameter("p1", DB2Parameter.Default) );
myCmd.Parameters.Add( new DB2Parameter("p2", 123) );
myCmd.Parameters.Add( new DB2Parameter("p3", "abcd") );
The
following example shows a positioned parameter that uses an unassigned
indicator:
[Visual Basic]
[C#]
DB2Connection myConn = new DB2Connection(myConnString);
myConn.EnableExtendedIndicators = true;
DB2Command myCmd = conn.CreateCommand();
myCmd.CommandText = "UPDATE T1 SET C1=? C2=? where C3=?";
myCmd.Parameters.Add(DB2Parameter.Unassigned);
myCmd.Parameters.Add( new DB2Parameter(null, 123) );
myCmd.Parameters.Add( new DB2Parameter(null, "abcd") );