DB2®ResultSet.SkipDeleted Property
Gets a value indicating if the DB2ResultSet instance will skip deleted rows when fetching.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Property SkipDeleted As Boolean
[C#]
public bool SkipDeleted {get;}
[C++]
public: __property bool get_SkipDeleted();
[JScript]
public function get SkipDeleted() : Boolean;
Property value
true
if
the DB2ResultSet skips deleted rows; otherwise, false
.
Remarks
Depending on the data server your application is connected to, the attributes of the DB2ResultSet instance can be different than what the application assigned them to be in the DB2Command.ExecuteResultSet method. Use this property to verify that this DB2ResultSet instance skips deleted rows.
Example
[C#] The following example demonstrates how to determine if the DB2ResultSet instance skips deleted rows, and read data from it, if so.
[C#]
public static string getSalesData(DB2Connection conn)
{
string salesQuery = "SELECT * FROM SALES";
string salesData = "";
DB2Command cmd = new DB2Command(salesQuery, conn);
DB2ResultSet salesRS = cmd.ExecuteResultSet(
DB2ResultSetOptions.Scrollable |
DB2ResultSetOptions.Sensitive |
DB2ResultSetOptions.SkipDeleted);
if (salesRS.SkipDeleted)
{
if (salesRS.ReadAbsolute(3))
{
salesData = salesRS.GetDB2Date(0).ToString();
salesData += ", " + salesRS.GetDB2String(1).ToString();
salesData += ", " + salesRS.GetDB2String(2).ToString();
salesData += ", " + salesRS.GetDB2Int32(3).ToString();
}
}
return salesData;
}