Determines whether the end of a cursor has been reached.
PSCursorClass objects
cursorobject.EOF( )
Argument |
Description |
---|---|
cursorobject |
A variable that contains a reference to an instance of PSCursorClass |
Boolean. Returns true if the end of the cursor has been reached, and false if it has not.
At runtime, EOF has the following behavior:
Application server |
Runtime behavior |
---|---|
ASP |
Accesses the EOF property of the Recordset object |
JSP |
Calls the isAfterLast method on the ResultSet object to determine if the end of the cursor has been reached |
The following example uses EOF in a loop to determine whether all of the rows in a cursor have been processed:
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;
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 “dberror” as a variable of type boolean.