GetRowCount

Description

Retrieves the number of rows in a cursor.

Applies to

PSCursorClass objects

Syntax

cursorobject.GetRowCount( )

Argument

Description

cursorobject

A variable that contains a reference to an instance of PSCursorClass

Returns

Integer

Usage

At runtime, GetRowCount calculates the number of rows in the ResultSet object used by the cursor instance.

Examples

Example 1

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();