db.advance-recordset

function

Library: Database access (OMDB)
Import : omdb.xmd

Returns: TRUE if there is another result set or FALSE otherwise


Declaration
define external switch function db.advance-recordset
      modifiable db.field  record

Argument definitions

record
is a db.field shelf.


Purpose

Use db.advance-recordset to see if there is another result set, and to move to it if so.

Requirements

The database connection represented by db.database must be open (else external exception OMDB104).

Usage Notes

This procedure is useful when stored procedures produce mulitple result sets.

Example

The outermost tests for multiple result sets.

  db.execute proc
       result rset
  repeat
       output "<result-set>%n"
       repeat
           exit unless db.record-exists rset
           output "%n<record "
           repeat over rset
               output "%n%t" || key of rset || '= "' ||
                   db.reader of rset || '"'
           again
           output "/>%n"
           db.move-record rset
       again
       exit unless db.advance-recordset rset
       output "</result-set>%n"
  again