DbRSelect Function | |
Return the work area number of a relation.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION DbRSelect(
nRelation
) AS DWORD CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static uint DbRSelect(
Usual nRelation = default
)
Request Example
View SourceParameters
- nRelation (Optional)
- Type: Usual
The position of the desired relation in the list of work area relations.
The relations are numbered according to the order in which they were defined by relation setting.
Return Value
Type:
DWord
The work area number of the specified relation.
If there is no relation set for
nRelation, DBRSelect() returns 0.
Remarks
DBRSelect() is a database function used in combination with DBRelation() to determine the work area and linking expression of an existing relation. 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, 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
Examples
This example opens three database files, sets two child relations from the parent work area, then displays the linking expression to the second child work area as well as the target work area of the relation:
1USE invoices INDEX invoices NEW
2USE backorder INDEX backorder NEW
3USE customer INDEX customer NEW
4SET RELATION TO custnum INTO customer, ;
5 Ordernum INTO Backorder
6QOut(DBRelation(2), DBRSelect(2))
7
8QOut(Alias(DBRSelect(2))
9
Later you can query the same information from an unselected work area by using an aliased expression:
1USE archive NEW
2QOut(Customer->DBRelation(2))
3
4QOut(Customer->DBRSelect(2))
5
See Also