DBGateway_NextRow

4D - Documentation   Français   English   German   4D For ADO, Command Theme List   4D For ADO, Command Alphabetical List   Back   Previous   Next

version 2004


DBGateway_NextRow (selectID) Integer

ParameterTypeDescription
selectIDLongintSelect ID returned by DBGateway_Select
Function resultInteger1 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

4D - Documentation   Français   English   German   4D For ADO, Command Theme List   4D For ADO, Command Alphabetical List   Back   Previous   Next