Moves to the next row in a cursor.
PSCursorClass objects
cursorobject.MoveNext( )
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, MoveNext has the following behavior:
Application server |
Runtime behavior |
---|---|
ASP |
Calls the MoveNext method of the RecordSet object |
JSP |
Calls the next method on the ResultSet object |
The following example uses MoveNext to process all of the rows in a cursor. Each time the cursor position changes, it writes the column values for the current row to the HTML page:
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;
}
if ( dberror == true )
{
errobj = myconnect.GetError();
str = errobj.GetCode() + " " + errobj.GetMessage();
psDocument.Write ( str );
}