Lookup Table Functions

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]Note

The lookup_admin() functions do nothing since version 3.0 of CloudConnect and can be removed.

[Warning]Warning

Remember that you should not use the functions shown below in the init(), preExecute(), or postExecute() functions of CTL template.

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:

Legend:

1) These functions do nothing since version 3.0 of CloudConnect and can be removed from the code.

[Warning]Warning

Remember that the usage of the lookup_found(<lookup ID>) function of CTL1 is not too recommended.

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:

lookup(<lookup ID>,keyValue).<field name>

lookup_next(<lookup ID>).<field name>

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).