version 2004
DBGateway_NextRow (selectID) Integer
| Parameter | Type | Description | |
| selectID | Longint | Select ID returned by DBGateway_Select | |
| Function result | Integer | 1 if moved to next row; 0 if there is no next row |
Description
The DBGateway_NextRow command advances through the rows of the result. It also needs to be called to move onto the first row of the result (if it exists).
The function returns 1 if it successfully moved to the next row and 0 if no more rows exist in the result.
selectID is a Longint returned from DBGateway_Select.
Normally, you would call the method with a while loop, like:
While (0# DBGateway_NextRow(SelectID)) ...do stuff with content of the row... End While
Example
selID:= DBGateway_Select(connID;"SELECT num, name, amount FROM clients WHERE last_order_date > '2005-05-31'") If(selID#0) While(0# DBGateway_NextRow(selID)) DBGateway_GetIntegerField(selID;0;$clientNum) DBGateway_GetStringField(selID;1;$clientName) DBGateway_GetRealField(selID;2;$clientAmount) End While Else `handle error here End if