db.record-exists

function

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

Returns: TRUE if the data cursor points to a valid row, or FALSE otherwise.


Declaration
define external switch function db.record-exists
  read-only db.field record

Argument definitions

record
is a db.field shelf.


Purpose

Use db.record-exists to check whether or not the data cursor is positioned on an existing row.

Usage Notes

The data cursor points to the record set's currently active row.

The function uses a db.field shelf variable in which a db.query, db.execute or db.streaming-execute stored the record set.

Example:


         repeat
           exit unless db.record-exists my-query
  
           repeat over my-query
              output db.reader of my-query null '-DNF-'
              output '%t' when ! #last
           again
           output '%n'
  
           db.move-record my-query
         again