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

Number in ASP targets, int in JSP targets

Usage

At runtime, GetRowCount has the following behavior:

Application server

Runtime behavior

ASP

Gets the value of the RecordCount property of the RecordSet object

JSP

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:

myquery = "SELECT customer.cust_id, customer.cust_name
		FROM DBA.customer"; 
mycursor = myconnect.CreateCursor(myquery);
rowcount = mycursor.GetRowCount();

To use the same example in a JSP target, you must declare “mycursor” as a variable of type PSCursorClass before instantiating it and calling any methods on it. You must also declare “myquery” as a variable of type String, “myconnect” as a variable of type PSConnectionClass, and “rowcount” as a variable of type int.