xHarbour Reference Documentation > Function Reference |
Returns the child work area number of a relation.
DbRSelect( <nRelation> ) --> nWorkArea
The function returns as a numeric value the work area number of the relation specified with <nRelation>. The return value is zero if no relation is defined.
The function DbRSelect() determines the work area number of a child work area, the current work area is related to. It determines it from the ordinal position of a relation which is numbered according to the sequence a relation is defined with the SET RELATION command.
DbRSelect() is used in conjunction with DbRelation() which retrieves the relation expression of a relation. Pass the return value of DbRSelect() to Alias() to find out the alias name of the child work area.
See also: | DbFilter(), DbRelation(), DbSetRelation(), OrdSetRelation(), SET RELATION |
Category: | Database functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example opens three databases and defines two relations. // The result of various DbRSelect() calls is shown. PROCEDURE Main USE Order ALIAS Ord NEW USE Parts ALIAS Part NEW EXCLUSIVE INDEX ON PartNo TO PartNo USE Customer ALIAS Cust NEW EXCLUSIVE INDEX ON CustNo TO CustNo SELECT Ord SET RELATION TO CustNo INTO Cust, ; TO PartNo INTO Part ? Alias() // result: ORD ? DbRSelect(1) // result: 3 ? DbRSelect(2) // result: 2 ? Alias(DbRSelect(1)) // result: CUST ? Alias(DbRSelect(2)) // result: PART SELECT Part ? Alias() // result: PART ? DbRSelect(1) // result: 0 CLOSE ALL RETURN
http://www.xHarbour.com