Lookup

Kalipso - Form - Expressions - Functions - Functions Descriptions - Conditional Functions - Lookup

This Function returns a <boolean>, which is the result of a search for a record in a Database, in compliance with the specified Conditions.

Parameters

  • Table <unquoted string> - Table to perform the search on.

  • Column <unquoted string> - Column where to verify the condition.

  • Operator <unquoted string> - Operator to apply when verifying the condition. The Possible values for this parameter are:

    • < – Less than.

    • > - Higher than.

    • <= - Less than or equal to.

    • >= - Higher than or equal to.

    • = - Equal to

    • <> - Different from.

    • LIKE - Like to. Use this operator to perform generic searches using character "%".

    • NOT LIKE - Not like to. Use this operator to perform generic searches using character "%".

  • Value <string> or <numeric> - Value to compare the Column to. The type of this parameter depends on the database type of the Column.

Examples

Consider the following database table "Products":

Code

Name

Stock

001

Coca Cola

100

002

Pepsi Cola

200

003

Pork Chops

300

  • Example 1

Lookup(Products, Stock, >, 100) Result = TRUE

  • Example 2

Lookup(Products, Stock, >, 300) Result = FALSE

  • Example 3

Lookup(Products, Stock, >, 100, Stock, < 300) Result = TRUE

  • Example 4

Lookup(Products, Name, LIKE, "%Cola") Result = TRUE

  • Example 5

Lookup(Products, Name, LIKE, "Cola%") Result = FALSE

  • Example 6

Lookup(Products, Name, LIKE, "%Cola", Stock, >, 100) Result = TRUE

When you specify more than one condition, the operator used between the conditions is "AND". Therefore, something like "select (...) from (...) where (...) AND (...)" will be executed.

Last updated