system.db.execUpdate
This function is used in Python Scripting.
Description​
Executes an update query from a Named Query resource. If the Named Query is through a Store and Forward system, use system.db.execUpdateAsync instead.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.db.execUpdate(path, [parameters], [tx], [getKey], [project])
Parameters​
Type | Parameter | Description |
---|---|---|
String | path | The full path of the Named Query. |
Dictionary | parameters | A dictionary supplying parameters for the query. [optional] |
String | tx | A transaction ID, obtained from [beginNamedQueryTransaction](/docs/8.3/appendix/scripting-functions/system-db/system-db-beginNamedQueryTransaction) . If not specified, will not be part of a transaction. [optional] |
Boolean | getKey | If True, the primary key of the row inserted or updated in an update query will be returned. Default value is False. [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​
Integer - The result of the query. The result will be either the number of rows affected or the key value that was generated, depending on the value of the getKey
parameter.
Scope​
Gateway, Vision Client, Perspective Session
Code Example​
Simple Example
# This example runs a Named Query without any optional parameters in the Project scope.
# Request the Named Query to execute.
system.db.execUpdate("folderName/myNamedQuery")