Function DbROrdName() Foundation

Determines the index tag of a child work area.

Syntax
DbROrdName( <nRelation> | <cRelName> ) --> cTagName
Parameters
<nRelation>
<nRelation> is a positive integer indicating the ordinal position of the relation in a work area. The index tag name used for this relation is returned. The relations are numbered in the order like they were defined using DbSetRelation() or SET RELATION TO.
<cRelName>
Instead of the numeric ordinal, a string containing the name of the desired relation can be specified as first parameter.
Return

The function returns a string. It is the tag name of the index in the child work area used for the relation.

Description

The function DbROrdName() determines the tag name of the index used when a parent work area navigates the record pointer of a child work area. The expression returned is the one specified to the TAG option of the INDEX ON command. It usually corresponds to the tag name of the controlling index in a child work area.

Examples
Index expression of child work area
// The example demonstrates a few possibilites of obtaining 
// information about relations and child workares. 

PROCEDURE Main 
   LOCAL cName 

   USE ORDERS NEW VIA DBFNTX 
   INDEX ON Upper(CustNo+OrderNo) TAG Cust TO Orders 
   SET INDEX TO Orders 

   USE CUSTOMER NEW VIA DBFNTX 
   SET RELATION TO Upper(CustNo) INTO ORDERS 

   ? DbRList()                            // {CUSTOMER_ORDERS} 
   ? DbRelation( 1 )                      // Upper(CustNo) 

     cName := DbROrdname("CUSTOMER_ORDERS") 

   ? cName                                // Cust 
   ? Orders->(OrdKey( cName ))            // Upper(CustNo+OrderNo) 

   CLOSE ALL 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.