DB2 10.5 for Linux, UNIX, and Windows

DB2Command.ArrayBindCountOff Property

Public constant value, which can be used to reset the DB2Command.ArrayBindCount property back to non-array mode.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
Public Const ArrayBindCountOff As Integer
[C#]
public const int ArrayBindCountOff
[C++]
public const int ArrayBindCountOff;
[JScript]
public const int ArrayBindCountOff;

Property value

A constant public property that represents integer value of 0. The DB2Command.ArrayBindCountOff constant is used to reset the DB2Command.ArrayBindCount property to turn off multi-row insert, update, or delete.

Example

[C#] The following example sets ArrayBindCount property to the ArrayBindCountOff constant.

[C#]
public static void MyArrayBindSample(DB2Command cmd)
{
    int[] myArrayC1 = new int[3] { 10, 20, 30 };
    string[] myArrayC2 = new string[3] { "abc", "test", "zyz" };

    cmd.CommandText = "INSERT INTO T1 ( C1, C2) values ( ?, ? )";

    cmd.ArrayBindCount = 3;
    cmd.AtomicArrayInput = false;

    DB2Parameter Parm1 =  new DB2Parameter();
    Parm1.DB2Type = DB2Type.Integer;
    Parm1.Direction = ParameterDirection.Input;
    Parm1.Value = myArrayC1;
    cmd.Parameters.Add(Parm1);

    DB2Parameter Parm2 = new DB2Parameter();
    Parm2.DB2Type = DB2Type.Char;
    Parm2.Direction = ParameterDirection.Input;
    Parm2.Value = myArrayC2;
    cmd.Parameters.Add(Parm2);

    cmd.ExecuteNonQuery();

    cmd.ArrayBindCount = DB2Command.ArrayBindCountOff;
    cmd.Parameters.Clear();
}