function
Library: Database access (OMDB)
Import : omdb.xmd |
Returns: requested field data as a source |
define external string source function db.reader of value db.field field null value string null optional
Argument definitions
The db.reader function returns the requested field data as an OmniMark source.
The database connection represented by db.database must be:
The db.field object field must be associated with a query (else external exception OMDB302).
The data cursor must be positioned on an existing row (else external exception OMDB205).
To avoid external exception OMDB205, use the db.record-exists function to verify that the row exists prior to retrieving a field value.
If the record has a date, time, or timestamp field, the field's value will be formatted in the OmniMark Date and Time library format. (This format returns the time with a time zone offset from UTC time, which most databases do not provide.)
If the field value is NULL, this function returns either an empty string or a string specified as argument
null. The argument null, if it is used, should be outside of the normal range of
field values. If no such value exists, it is safer to use db.is-null
function instead.
repeat exit unless db.record-exists my-query repeat over my-query output db.reader of my-query null '-DNF-' output '%t' unless #last again output '%n' db.move-record my-query again