Retrieves the number of rows in a cursor.
PSCursorClass objects
cursorobject.GetRowCount( )
Argument |
Description |
---|---|
cursorobject |
A variable that contains a reference to an instance of PSCursorClass |
Integer
At runtime, GetRowCount calculates the number of rows in the ResultSet object used by the cursor instance.
The following example gets the row count for a cursor that retrieves rows from the customer table. In this example, “myquery” is a variable of type String, “myconnect” is a variable of type PSConnectionClass, “mycursor” is a variable of type PSCursorClass, and “rowcount” is a variable of type int:
myquery = "SELECT customer.cust_id, customer.cust_name FROM DBA.customer";
mycursor = myconnect.CreateCursor(myquery);
rowcount = mycursor.GetRowCount();