DB2 Version 10.1 for Linux, UNIX, and Windows

DB2RowId Structure

Represents the ROWID DB2® data type. Encapsulates the byte [ ] .NET data type.

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

Syntax

[Visual Basic]
Public Structure DB2RowId
[C#]
public struct DB2RowId
[C++]
public value class DB2RowId

Remarks

The DB2RowId class is only supported for applications with connections to DB2 for z/OS® databases or to DB2 for i databases. DB2RowId structures can only be instantiated by reading ROWID columns from a database (by using the GetDB2RowId method from the DB2DataReader, DB2ResultSet, DB2Record, or DB2UpdatableRecord classes).

Example

[C#] The following example demonstrates how to use the DB2RowId structure.

[C#]
  public static string getParam(DB2Connection conn, DB2RowId rowid)
  {
    string mySelectQuery = "SELECT EMPNO FROM EMPLOYEE WHERE EMP_ROWID=ROWID(?)";
    DB2Command myCommand = new DB2Command(mySelectQuery, conn);
    DB2Parameter p1 = new DB2Parameter();
    p1.Value = rowid;
    myCommand.Parameters.Add(p1);

    DB2DataReader reader = myCommand.ExecuteReader();

    if (reader.Read())
    {
      DB2String selectValue = reader.GetDB2String(0);

      if (!selectValue.IsNull) { return selectValue.ToString(); }
    }

    return "NULL";
  }

Thread safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Version information

Last update
This topic was last updated for: IBM DB2 Version 9.7
.NET Framework version
Supported in: 2.0, 3.0, 3.5 and 4.0
IBM Data Server Client
Supported in: IBM DB2 Version 9