Skip to main content
Version: 6.1

Select

Select

Selects one or more records from the specified Database Table.

Action available for the following operating systems:

OS Supported: Android, iOS, Win, Win32

Parameters​

SELECT

  • From - Database Table where to retrieve the records from.
  • Function - Function applied to the specified column. For further information about this parameter, please consult the documentation of your Database or SQLite if you're working off-line.
    • AVG - Returns the average value of the specified Column.
    • COUNT - Returns the number of records.
    • MAX - Returns the maximum value of the specified Column.
    • MIN - Returns the minimum value of the specified Column.
    • SUM - Returns the sum of the values of the specified Column.
  • Column - Column to be retrieved.
  • Into <target> - Control or Variable where to store the retrieved value.
  • Nth From - Table where to retrieve the records from.
  • Nth Function <unquoted string> - Function applied to the specified column. For further information about this parameter, please consult the documentation of your Database or SQLite if you're working off-line.
  • Nth Column <unquoted string> - Column to be retrieved.
  • Nth Into <unquoted string> - Control or Variable where to store the retrieved value.
  • Ignore Database Masks - If you've defined a Mask for the specified Column in the Table properties and:
    • This option is checked - The value is return the Kalipso format.
    • This option is unchecked - The value is returned with the Mask format.
  • Clear Data When No Record is Returned - If this option is checked and no record is returned, all the targets (Into parameter) are cleared.
  • Where <Kalipso Filter> or <string> - Condition to specify which records should be retrieved. Check Expressions chapter for more information about Kalipso Filter and String expressions.

Usage​

This function generates a Select operation that exists in every SQL database, and is used to query the database and retrieve data according to one ore more conditions.

Consider the following Database Table, and the following Variables:

Products
CodeNameStock
1Coca Cola100
2Pepsi Cola200
3Pork Chops300
CodeNameStock
VAR(0)StringKalipso
VAR(1)Numeric0
VAR(2)StringKalipso1

Consider that column Code is Numeric, column Name is String and column Stock is Numeric.
Note that the table showing variables isn't a database table, its purpose is to show only the values and type of each variable.

Example 1​

FromFunctionColumnInto
Products<none>CodeVAR(0)
Products<none>NameVAR(1)
Products<none>StockVAR(2)
WhereFIELD(Products,Code)=001
Clear DataYes

Result:

VariableTypeValue
VAR(0)String1
VAR(1)NumericCoca Cola
VAR(2)String100

Example 2​

FromFunctionColumnInto
ProductsAVGCodeVAR(0)
Products<none>NameVAR(1)
ProductsSUMStockVAR(2)
WhereFIELD(Products,Code)=004
Clear DataYes

Result:

VariableTypeValue
VAR(0)Numeric
VAR(1)String
VAR(2)Numeric

Example 3​

FromFunctionColumnInto
Products<none>CodeVAR(0)
Products<none>NameVAR(1)
Products<none>StockVAR(2)
WhereFIELD(Products,Code)=004
Clear DataNo

Result:

VariableTypeValue
VAR(0)Stringkalipso
VAR(1)Numeric0
VAR(2)Stringkalipso1

Example 4​

FromFunctionColumnInto
ProductsAVGCodeVAR(0)
Products<none>NameVAR(1)
ProductsSUMStockVAR(2)
WhereFIELD(Products,Code)=004
Clear DataNo

Result:

VariableTypeValue
VAR(0)Numeric
VAR(1)String
VAR(2)Numeric
info

In this example, the option Clear Data is disabled but are used functions AVG and SUM , and because of that, this operation return on record, therefore types are enforced.

Example 5​

FromFunctionColumnInto
ProductsSUMStockVAR(2)
WhereFIELD(Products,Code)<>0
Clear DataYes

Result:

VariableTypeValue
VAR(0)Stringkalipso
VAR(1)Numeric0
VAR(2)Numeric600

Example 6​

FromFunctionColumnInto
ProductsMINCodeVAR(0)
ProductsCOUNTNameVAR(1)
ProductsSUMStockVAR(2)
WhereFIELD(Products,Code)<> ""
Clear DataNo

Result:

VariableTypeValue
VAR(0)Numeric1
VAR(1)String3
VAR(2)Numeric600
warning

Notice that, as you can see in the examples above, Variable types are enforced, except if there is no result of the select operation and parameter Clear Data isn't checked.

info

When you specify more than one condition in Where parameter, the operator used between the conditions is "AND" or "OR".

info

You can use the RECORDCOUNT Keyword to know how many records where returned.