swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

dbFieldValue

 
 

Library: Database access (OMDB) legacy library
Include: omdb.xin
Return type: Source
Returns: 

Requested field data as a source.


Declaration

  define external source function dbFieldValue
         value dbField  field
    null value stream   null     optional

Argument definitions

field
is a dbField object associated with a field in the current record in an active SQL query record set.
null
is an optional string that will be returned instead of a zero-length string when the field value is NULL.


Purpose

The dbFieldValue function returns the requested field data as an OmniMark source.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omdb.xin"

The database connection represented by dbDatabase must be:

The dbField 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).

Usage Notes

To avoid external exception OMDB205, use the dbRecordExists 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 you specify for null within the function call.

Example


        repeat
           exit unless dbRecordExists my-query

           repeat over my-query
              output dbFieldValue my-query
                 null '-dnf-'
              output '%t' when ! #last
           again
           output '%n'

           dbRecordMove my-query
         again

        Other Library Functions
   dbClose
   dbCommit
   dbDatabase
   dbExecute
   dbField
   dbFieldPrepare
   dbFieldSink
   dbFieldValue
   dbIsVersionCompatible
   dbLibraryVersion
   dbLibraryVersionOCI8
   dbLibraryVersionOCI8i
   dbLibraryVersionODBC
   dbOpenOCI8
   dbOpenOCI8i
   dbOpenODBC
   dbProcedure
   dbProcedureClose
   dbProcedureExecute
   dbProcedureOpen
   dbQuery
   dbRecordExists
   dbRecordMove
   dbRecordSetMove
   dbRollback
   dbSetTransactionType
   dbStatement
   dbStatementCompile
   dbStatementDiscard
   dbStatementExecute
   dbStatementStreamingExecute
   dbTable
   dbTableClose
   dbTableDelete
   dbTableInsert
   dbTableOpen
   dbTableUpdate
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:05 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.