C5_DBRSELECT

 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



2 responses to “C5_DBRSELECT

  1. Pingback: C5_USE | Viva Clipper !

  2. Pingback: C5_SET RELATION | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.