--- title: "system.db.execScalar" description: "Executes a scalar query from a Named Query resource." --- # system.db.execScalar > Executes a scalar query from a Named Query resource. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions This scripting function has no [Client Permission](ignition-modules\vision\vision-project-properties\vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.db.execScalar(path, [parameters], [tx], [project])` ### Parameters |Type | Parameter | Description |------- | ------- | ----- |String| `path` | The full path of the named query.| |Dictionary | `parameters` | A dictionary of parameters for the query. [optional]| |String| `tx` | A transaction ID, obtained from [`beginNamedQueryTransaction`](appendix/scripting-functions/system-db/system-db-beginNamedQueryTransaction.md). If not specified, will not be part of a transaction. [optional]| |String| `project` | A project name that the query exists in. [optional] **Note**: If no project is specified when run in the Gateway scope, an associated project or the Gateway scripting project will be used.| ### Returns **Any** - The scalar result of the query, as either a single value or None if no rows were returned. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Simple Example - Without Parameters" # This example runs without any of the optional parameters in the Project scope. # Request the Named Query to execute. system.db.execScalar("folderName/myNamedQuery") ``` ```python title="Gateway Scope Example" # This example runs a Named Query without the optional parameters in the Gateway scope. # Request the Named Query to execute. system.db.execScalar("folderName/myNamedQuery", "ProjectName") ```