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​
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 . 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​
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")