[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DBFIELDINFO()
 Return and optionally change information about a field
------------------------------------------------------------------------------
 Syntax

     DBFIELDINFO(<nInfoType>,
        <nFieldPos>,
        [<expNewSetting>]) --> uCurrentSetting

 Arguments

     <nInfoType> determines the type of information as specified by the
     constants below.  Note, however, that not all constants are supported
     for all RDDs, nor are all constants supported by all field types.  These
     constants are defined in the Dbstruct.ch header file, which must be
     included (#include) in your application.

     Field Information Type Constants
     ------------------------------------------------------------------------
     Constant            Description
     ------------------------------------------------------------------------
     DBS_BLOB_LEN        Returns the storage length of the data in a BLOB
                         (memo) file.
     DBS_BLOB_OFFSET     Returns the file offset of the data in a BLOB (memo)
                         file.
     DBS_BLOB_POINTER    Returns a numeric pointer to the data in a blob
                         file. This pointer can be used with BLOBDirectGet(),
                         BLOBDirectImport(), etc.
     DBS_BLOB_TYPE       Returns the data type of a BLOB (memo) field. This
                         is more efficient than using Type() or ValType()
                         since the data itself does not have to be retrieved
                         from the BLOB file in order to determine the type.
     DBS_DEC             Number of decimal places for the field.
     DBS_LEN             Length of the field.
     DBS_NAME            Name of the field.
     DBS_TYPE            Data type of the field.
     ------------------------------------------------------------------------

     <nFieldPos> is the position of the field in the database file
     structure.

     <expNewSetting> is reserved for CA-Clipper future use.  It can be
     omitted or specified as NIL.

 Returns

     DBFIELDINFO() returns the current setting.

 Description

     DBFIELDINFO() retrieves information about the state of a field.  By
     default, this function operates on the currently selected work area.  It
     can be made to operate on an unselected work area by specifying it
     within an aliased expression.

     The field information that is available is defined by the RDD.

     To support RDDs for other database models (such as dictionary-based
     databases) that store more information about each field or column, the
     CA-Clipper 5.3 RDD API has been enhanced.  The DBFIELDINFO() is designed
     to allow for additional <nInfoType> values that can be defined by third-
     party RDD developers.

 Examples

     .  The following example uses DBFIELDINFO() to retrieve field
        information:

        #include Dbstruct.ch

        QOut(DBFIELDINFO(DBS_NAME, 1))         // Same as FIELDNAME(1)

        FUNCTION DBOUTSTRUCT()
           LOCAL aStruct := {}
           LOCAL nFcount, i

           nFcount := FCOUNT()
           FOR i := 1 TO nFcount
              AADD(aStruct, {FIELDNAME(i), ;
                                DBFIELDINFO(DBS_TYPE, i), ;
                                DBFIELDINFO(DBS_LEN, i),  ;
                                DBFIELDINFO(DBS_DEC, i)})
           NEXT
           RETURN aStruct

 Files   Library is CLIPPER.LIB, header file is Dbstruct.ch.


See Also: DBINFO() DBORDERINFO() DBRECORDINFO()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson