Lookup

From ObjectVision

Jump to: navigation, search

Relational functions lookup

Contents

syntax

  • lookup(relation, values)
  • values[relation]

definition

lookup(relation,values) or values[relation] results in a data item with the values of the argument values for the domain of the relation attribute.

The relation argument defines which values are looked up in the domain of the values attribute.

The resulting data item has the same values unit as the values argument and the same domain unit as the relation argument.

applies to

description

The relation towards the domain unit of argument values can de derived from any foreign key attribute with the rlookup function.

The rjoin function can be used to relate on foreign key attributes, without the explicit use of index numbers.

since version

5.15

example

attribute<degrees> LTemp (City) := lookup(City/Region_rel, Region/Temp); 
attribute<degrees> LTemp (City) := Region/Temp[City/Region_rel];
City/Region_rel LTemp
0 12
1 11
2 null
1 11
3 14
null null
3 14

domain City, nr of rows = 7

Region/Temp
12
11
null
14
13

domain Region, nr of rows = 5

see also

Personal tools