swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
OMX  

dbField

 
 

Library: Database access (OMDB) legacy library
Include: omdb.xin


Purpose

The dbField OMX component allows you to access the data value that exists within a row of a database record set field. This OMX component is a shelf, where each field value is placed in a separate item on the shelf, and each item key is the unique name of the field. Use the dbField OMX component in conjunction with dbDatabase to create a connection to a database and obtain a read-only set of data from that database.

Usage Notes

The OmniMark Database dynamic link library file ("omdb.dll") creates the dbField OMX component. The related include file ("omdb.xin") defines the interface to that component. To use dbField OMX components in your program, you must include the following include statement in your program:

     include "omdb.xin"

Within your program, you can create as many instances of the dbField OMX component as you require by declaring global and local shelves of type "dbField". These shelves must be declared as variable.

When you use the dbQuery function, the dbField shelf is automatically bound to the record set created by the SQL query that you specify in that function. When you move the data cursor in the record set, using the dbRecordMove function, the dbField shelf is automatically repopulated with whatever values are in the current row. You retrieve values from the dbField OMX variable with the dbFieldValue function.

Please refer to OMX Components for a general description of OMX components and how they are used.

Related OMDB library functions:

The functions

are used to establish dbField components. The dbField objects are used by the following OMDB library functions:

Example

Once you have declared your dbField OMX shelves, you can use those variables in the dbQuery and dbFieldValue functions that are part of the OmniMark Database legacy library. For example:

        include "omdb.xin"
  
        process
           local dbDatabase my-database
           local dbField my-query variable
  
           local stream SQL-query initial
           {  "select C.CourseName, S.StudentName, SC.Grade " ||
              "from Student S, Course C, StudentCourse SC " ||
              "where SC.CID = C.CID and S.SID = SC.SID "
           }
  
           set my-database to dbOpenODBC "MyDatabase"
  
           dbQuery my-database SQL SQL-query record  my-query
  
           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
   dbRecordMoveDynamic
   dbRecordSetMove
   dbRollback
   dbSetTransactionType
   dbStatement
   dbStatementCompile
   dbStatementDiscard
   dbStatementExecute
   dbStatementStreamingExecute
   dbTable
   dbTableClose
   dbTableDelete
   dbTableInsert
   dbTableOpen
   dbTableUpdate
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.