Represents the ROWID DB2® data type. Encapsulates the byte [ ] .NET data type.
[Visual Basic]
Public Structure DB2RowId
[C#]
public struct DB2RowId
[C++]
public value class DB2RowId
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).
[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";
}
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.