EOF

Description

Determines whether the end of a cursor has been reached.

Applies to

PSCursorClass objects

Syntax

cursorobject.EOF( )

Argument

Description

cursorobject

A variable that contains a reference to an instance of PSCursorClass

Returns

Boolean. Returns true if the end of the cursor has been reached, and false if it has not.

Usage

At runtime, EOF calls the isAfterLast method on the ResultSet object to determine if the end of the cursor has been reached.

Examples

Example 1

The following example uses EOF in a loop to determine whether all of the rows in a cursor have been processed:

String myquery;
PSConnectionClass myconnect;
PSCursorClass mycursor;
boolean dberror;
myConnect = psServer.CreateConnection(pageContext, 
	"com.sybase.jdbc2.jdbc.SybDriver",
	"jdbc:sybase:Tds:localhost:2638", "dba", "sql",
	true);
...
myquery = "SELECT products.prod_id, products.prod_name
		FROM DBA.products"; 
mycursor = myconnect.CreateCursor(myquery);

if ( myconnect.GetError() == null )
		{
		for (i=0; (!mycursor.EOF()); i++)
 			{
 			psDocument.Write(mycursor.GetValue(0) + " " +
				mycursor.GetValue(1));
 			psDocument.Write("<BR>");
 			mycursor.MoveNext();
 			}
else dberror = true;