Difference between revisions of "RLOOKUP()"

From Lianjapedia
Jump to: navigation, search
(Products)
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to perform a cross-table lookup for a specified key expression
 
Function to perform a cross-table lookup for a specified key expression
 
  
 
==Syntax==
 
==Syntax==
 
RLOOKUP(<key expression>, <workarea | alias> [,<expN> | <tag name>])
 
RLOOKUP(<key expression>, <workarea | alias> [,<expN> | <tag name>])
 
  
 
==See Also==
 
==See Also==
 
[[SET RELATION]], [[LOOKUP()]], [[SEEK()]]
 
[[SET RELATION]], [[LOOKUP()]], [[SEEK()]]
 
  
 
==Description==
 
==Description==
Line 17: Line 14:
  
 
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.
 
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==
 
==Example==
Line 34: Line 30:
 
.T.
 
.T.
 
</code>
 
</code>
 
  
 
==Products==
 
==Products==
Recital, Recital Server
+
Lianja, Lianja Server
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Search Functions]]

Latest revision as of 10:24, 12 December 2012

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

Lianja, Lianja Server