Difference between revisions of "RLOOKUP()"

From Recital Documentation Wiki
Jump to: navigation, search
(Products)
 
Line 37: Line 37:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital, Recital Server
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 15:18, 7 December 2009

Purpose

Function to perform a cross-table lookup for a specified key expression


Syntax

RLOOKUP(<key expression>, <workarea | alias> [,<expN> | <tag name>])


See Also

SET RELATION, LOOKUP(), SEEK()


Description

The RLOOKUP() function looks up the specified <key expression> in the master index of the specified <workarea | alias>. The <workarea | alias> is the workarea or alias name of an open table. To search in an index which is not the current master index, the optional <expN> | <tag name> parameter can be used. The <expN> is for single indexes and indicates the required index by the numerical index order in which the indexes were opened. For tag / multiple indexes, the tag name must be specified as a string.

The RLOOKUP() function returns True (.T.) or False (.F.), depending on the success of the lookup operation.

This function is especially useful when used in the Applications Data Dictionary (ADD) for maintaining referential integrity rules. See the CREATE command for details of the Applications Data Dictionary.


Example

use func in 1 index funcno
use depts in 2 index deptnum
seek "300"
? iif(rlookup(depts->funcno,func,1),func->dept_name,"No Department.")
Research and Development
 
use customer.rdb
index on account_no tag account_no
index on upper(last_name) tag uplast
index on zip tag zip
? rlookup("STEREK",customer,"uplast")
.T.


Products

Recital, Recital Server