Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scripting_function


Panel
titleDescription

This clears the cache of a Named Query. If called from the shared scope (i.e., Tag Event Scripts, Alarm Pipelines, etc.) then the name of the project must be passed as a parameter.

Client permissions restrictions


Panel
titleSyntax - Project Scope

system.db.clearNamedQueryCache(path)

  • Parameters

String path The path to the named query the Named Query for which you want to clear the cache.

  • Returns

Nothing

  • Scope

Vision Client, Perspective Session


Panel
titleSyntax - Shared Scope

system.db.clearNamedQueryCache(project, path)

  • Parameters

String project The project that contains the Named Query whose cache needs to be cleared.

Stringpath The path to the named query the Named Query for which you want to clear the cache.

  • Returns

Nothing

  • Scope

Gateway

Panel
titleCode Examples
Code Block
languagepy
titleExample - Clear Named Query Cache for a Specific Project
# Calling this simply clears all Named Query caches. 
# This example is being called from the shared scope. If called from the project scope, the projectName parameter should be omitted. 


projectName = "myProject"
namedQueryPath = "folder/selectFromInventory"

system.db.clearNamedQueryCache(projectName, namedQueryPath)
Code Block
languagepy
titleExample - Clear Named Query Cache
# If the same Named Query is called multiple times with different parameters in a single script, then we can clear the caches once we're done with the following.
# This example assumes the script is running in the project scope. If called from the Shared Scope, the name of the project would need to be included. 

namedQueryPath = "myUpdateQuery"

# This creates one cache.
params = {"param1":"A"}
system.db.runNamedQuery(namedQueryPath, params)

# This creates a separate cache.
params = {"param1":"B"}
system.db.runNamedQuery(namedQueryPath, params)

# Clear all of the caches from the specified Named Query. Note that all caches are cleared, including those generated from elsewhere on the Gateway. 
system.db.clearNamedQueryCache(namedQueryPath)
Panel
titleKeywords

system db clearNamedQueryCache, db.clearNamedQueryCache