Skip to main content
Version: 8.3 Beta 🚧

system.db.execQuery

This function is used in Python Scripting.

Description​

Executes a select query from a Named Query resource.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.db.execQuery(path, [parameters], [tx], [project])

Parameters​

TypeParameterDescription
StringpathThe full path of the named query.
DictionaryparametersA dictionary of parameters for the query. [optional]
StringtxA transaction ID, obtained from beginNamedQueryTransaction. If not specified, will not be part of a transaction. [optional]
StringprojectA 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​

Dataset - The result of the query, as a dataset or a single value for a scalar query.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

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.execQuery("folderName/myNamedQuery")
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.execQuery("folderName/myNamedQuery", "ProjectName")