[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DBRSELECT()
 Return the target work area number of a relation
------------------------------------------------------------------------------
 Syntax

     DBRSELECT(<nRelation>) --> nWorkArea

 Arguments

     <nRelation> is the position of the desired relation in the list of
     current work area relations.  The relations are numbered according to
     the order in which they were defined with SET RELATION.

 Returns

     DBRSELECT() returns the work area number of the relation specified by
     <nRelation> as an integer numeric value.  If there is no RELATION SET
     for <nRelation>, DBRSELECT() returns zero.

 Description

     DBRSELECT() is a database function used in combination with DBRELATION()
     to determine the work area and linking expression of an existing
     relation created with the SET RELATION command.  DBRSELECT() returns the
     work area defined by the INTO clause.  DBRELATION() returns the linking
     expression defined by the TO clause.  To determine the alias of the
     relation instead of the work area number, use the expression
     ALIAS(DBRSELECT(<nRelation>)).

     By default, DBRSELECT() operates on the currently selected work area.
     It will operate on an unselected work area if you specify it as part of
     an aliased expression (see example below).

 Examples

     .  This example opens three database files, sets two child
        relations from the parent work area, and then displays the linking
        expression to the second child work area, as well as the target work
        area of the relation:

        USE Invoices INDEX Invoices NEW
        USE BackOrder INDEX BackOrder NEW
        USE Customer INDEX Customer NEW
        SET RELATION TO CustNum INTO Customer, ;
              OrderNum INTO BackOrder
        //
        ? DBRELATION(2), DBRSELECT(2)         // Result: OrderNum 3

        ? ALIAS(DBRSELECT(2))               // Result: BACKORDER

     .  Later, you can query the same information from an unselected
        work area by using an aliased expression:

        USE Archive NEW
        ? Customer->(DBRELATION(2))      // Result: OrderNum
        ? Customer->(DBRSELECT(2))         // Result: 3

 Files   Library is CLIPPER.LIB.


See Also: DBFILTER() DBRELATION() RLOCK() UNLOCK SET RELATION
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson