--- title: "executeQuery" description: "Executes a select query using the given ConnectionName (or the default connection it omitted) and stores the result into a global ResultSetName." --- # executeQuery > Executes a select query using the given ConnectionName (or the default connection it omitted) and stores the result into a global ResultSetName. **This function is used by Ignition's Expression language.** ## Description :::note This function is only available in [Transaction Group Expression Items](sql-bridge-transaction-groups/understanding-transaction-groups/expression-items/expression-items.md) and [Expression Tags](tags/creating-memory-expression-and-query-tags/creating-memory-expression-and-query-tags.md). ::: ## Syntax `executeQuery(query, resultName[, datasource])` - Parameters - string **query** - The query to execute. - string **resultName** - The name of the global result set. - string **datasource** - Optional. The name of the database connection. - Results - int - The number of rows in the returned table. ## Examples ```python title="Code Snippet" executeQuery("SELECT * FROM table", "MyResult", "MySQLConnection") //would store the results in "MyResult" and return an integer based on how many rows were in the table. ```