Skip to main content
Version: 6.1

SQL Advanced

SQL Advanced

Runs the specified query in the specified database. This Action allows you to run online queries without having to add Tables to a Database Connection Profile.

Action available for the following operating systems:

OS Supported: Android, iOS, Win, Win32

Parameters​

Execution mode

  • Online - The query will be executed in the specified Database.
    • Database Connection Profile - Database Connection Profile where the query will be executed. It's not mandatory to have tables defined in the profile to be able to run this Action.
  • Offline - The query will be executed in the Local Database which holds all the offline Tables.
  • Clear Target When No Data is Returned - If this option is checked and no record is returned, all the Targets are cleared.
  • SQL Sentence <string> - SQL query to perform.

Targets

  • Column <unquoted string> - Name of the column to retrieve. This parameter is merely informative and has no impact whatsoever. What matters is the index of the Column. Therefore, this refers to the first returned Column.
  • Target <target> - Control or Variable where to save the value of the first Column.
  • nth Column <unquoted string> - Name of the column to retrieve. This parameter is merely informative and has no impact whatsoever. What matters is the index of the Column. Therefore, this refers to the nth returned Column.
  • nth Target <target> - Control or Variable where to save the value of the nth Column.

Usage​

Consider the following Database Table, and the following Variables:

Products
CodeNameStock
1Coca Cola100
2Pepsi Cola400
3Pork Chops300
VariableTypeValue
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​

Execution modeOffline
Clear Target DataYes
SQL Sentence"Select Name from Products"
Clear DataYes
ColumnTarget
CodeVAR(0)
NameVAR(1)
StockVAR(2)

Result:

VariableTypeValue
VAR(0)Numeric1
VAR(1)StringCoca Cola
VAR(2)Numeric100

Example 2​

Execution modeOffline
Clear Target DataNo
SQL Sentence"Select Name from Products Where Products.Code=4"
Clear DataYes
ColumnTarget
CodeVAR(0)
NameVAR(1)
StockVAR(2)

Result:

VariableTypeValue
VAR(0)StringKalipso
VAR(1)Numeric0
VAR(2)StringKalipso1
info

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