Contents
Partner Programs
Sepasoft - MES Modules
Cirrus Link - MQTT Modules
Resources
Knowledge Base Articles
Inductive University
Forum
IA Support
SDK Documentation
All Manual Versions
Ignition 8.0
Ignition 7.9
Ignition 7.8
This feature was removed from Ignition in version 8.0.0
This function is only available in Transaction Group Expression Items and Expression Tags.
Executes a select query using the given connectionName (or the default connection it omitted) and returns the first scalar value from the resultset.
executeScalarQuery(query[, connectionName])
string query - The query to execute.
string connectionName - Optional. The name of the database connection.
Value - The first value returned from the query.
For the following examples, suppose there was a table 'weights' that contained these values.
ProductCode | Quantity | Weight |
---|---|---|
BAN_002 | 380 | 3.243 |
BAN_010 | 120 | 9.928 |
APL_000 | 125 | 1.287 |
FWL_220 | 322 | 7.889 |
executeScalarQuery("SELECT MAX(Quantity) FROM weights", "MySQLConnection") //would return 380
executeScalarQuery("SELECT * FROM weights", "MySQLConnection") //would return a string "BAN_002"