In your graphs you are also using lookup tables. You can use
them in CTL by specifying ID of the lookup table and placing it as an
argument in the lookup()
,
lookup_next()
, lookup_found()
, or
lookup_admin()
functions.
Note | |
---|---|
The |
Warning | |
---|---|
Remember that you should not use the functions shown below
in the |
You have five options depending on what you want to do with the lookup table. You can create lookup table, get the value of the specified field name from the lookup table associated with the specified key, or get the next value of the specified field name from the lookup table, or (if the records are duplicated) count the number of the records with the same field name values, or you can destroy the lookup table.
Now, the key in the function below is a sequence of values of
the field names separated by comma (not semicolon!). Thus, the keyValue
is
of the following form:
keyValuePart1,keyValuePart2,...,keyValuePartN
.
See the mentioned following five options:
lookup_admin(<lookup ID>,init)
1)
This function initializes the specified lookup table.
lookup(<lookup ID>,keyValue).<field name>
This function searches the first record whose key value is
equal to the value specified as the second argument in this
function and returns the value of <field name>
. Here,
<field name>
is a field of the lookup
table metadata.
lookup_next(<lookup ID>).<field name>
After call the lookup()
function, the
lookup_next()
function searches the next record
whose key value is equal to the value specified as the second
argument in the lookup()
function and returns
the value of <field name>
value. Here,
<field name>
is a field of the lookup
table.
lookup_found(<lookup ID>)
After call the lookup()
function, the
lookup_found()
function returns the number of
records whose key value is equal to the value specified as the
second argument in the lookup()
function.
lookup_admin(<lookup ID>,free)
1)
This function destroys the specified lookup table.
Legend:
1) These functions do nothing since version 3.0 of CloudConnect and can be removed from the code.
Warning | |
---|---|
Remember that the usage of the The reason is that such expression searches the records through the whole lookup table which may contain a great number of records. You should better use a pair of two functions in a loop:
Especially DB lookup tables may return -1 instead of real count of records with specified key value (if you do not set Max cached size to a non-zero value). |