Skip to end of metadata
Go to start of metadata

  This feature was removed from Ignition in version 8.0.0

This function is used by Ignition's Expression language.

Description

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.

Syntax

executeScalarQuery(query[, connectionName])

  • Parameters

string query - The query to execute.

string connectionName - Optional. The name of the database connection.

  • Results

Value - The first value returned from the query.

Examples

For the following examples, suppose there was a table 'weights' that contained these values.

ProductCodeQuantityWeight
BAN_0023803.243
BAN_0101209.928
APL_0001251.287
FWL_2203227.889
Code Snippet
executeScalarQuery("SELECT MAX(Quantity) FROM weights", "MySQLConnection")  //would return 380
Code Snippet
executeScalarQuery("SELECT * FROM weights", "MySQLConnection") //would return a string "BAN_002"
  • No labels