Skip to main content
Version: 8.3 Beta 🚧

system.db.runSFNamedQuery

This function is used in Python Scripting.

Description​

Runs a named query that goes through the Store and Forward system. Note that the number of parameters in the function is determined by scope. Both versions of the function are listed on this page.

note

Only Update Named Queries are allowed in Store and Forward.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Gateway Scope Syntax​

system.db.runSFNamedQuery([project], path, params)

Parameters​

TypeParameterDescription
StringprojectThe project name the query exists in. [optional]
StringpathThe path to the Named Query to run. Note that this is the full path to the query, including any folders.
Dictionary[String, Any]paramsA Python dictionary of parameters for the Named Query to use.

Returns​

Boolean - Returns true if successfully sent to the Store and Forward system.

Scope​

Gateway, Perspective Session

Project Scope Syntax​

system.db.runSFNamedQuery(path, params)

Parameters​

TypeParameterDescription
StringpathThe path to the Named Query to run. Note that this is the full path to the query, including any folders.
Dictionary[String, Any]paramsA Python dictionary of parameters for the Named Query to use.

Returns​

Boolean - Returns true if successfully sent to the Store and Forward system.

Scope​

Vision Client

Code Examples​

Simple Example - Without Parameters
# This example runs a Named Query without any parameters in the Project scope.
# The second argument in the function is NOT optional, so Named Queries that do not require a parameter
# must still pass an empty dictionary as an argument.

# Request the Named Query with an empty dictionary as the second parameter.
system.db.runSFNamedQuery("folderName/myNamedQuery", {})
Gateway Scope Example
# This example runs a Named Query without any parameters in the Gateway scope.
# The last argument in the function is NOT optional, so Named Queries that do not require a parameter
# must still pass an empty dictionary as an argument.

# Request the Named Query to execute.
system.db.runSFNamedQuery("ProjectName", "folderName/myNamedQuery", {})
Simple Example - With Parameters
# This example runs a Named Query while passing some parameters in the Project scope.
# The Named Query is assumed to have two parameters already defined on the Named Query:
# param1 : A string
# param2 : An integer

# Create a Python dictionary of parameters to pass
params = {"param1":"my string", "param2":10}

# Run the Named Query
system.db.runSFNamedQuery("myUpdateQuery", params)