Menu

sqlExecuteAction

Adam Tauno Williams

OIE

sqlExecuteAction

Execute an arbitrary SQL command sequence.

sqlExecuteAction is unique among the five actions releted to utilizing SQL data sources in that it neither consumers or produces [StandardXML] messages.

See also:
- [sqlInsertAction]
- [sqlDeleteAction]
- [sqlUpsertAction]
- [sqlUpdateAction]

Parameters

Parameter Description
dataSource The name of an SQL datasource defined via the [OIESQLDataSources] server default.
queryText The command sequence to execute; this is a text string, possibly multi-line, which is processed for label substitution.
doCommit

Example

Connects to the data source "fribitz" and executes the specified UPDATE statement; the value of '$XATTR_BATCHID;' is replaced with the value of the [XATTR] "batchid" of such an [XATTR] is defined. If no such XATTR exists an exception will be raised.

<action name="actionActivity" id="000010"
        extensionAttributes="ResetXrefrWorkingSet/000010">
  <input property="SelectedData" formatter="StandardRaw"/>
  <attributes xmlns="">
    <extension name="activityName">sqlExecuteAction</extension>
    <extension name="dataSource">fribitz</extension>
    <extension name="queryText">
UPDATE tmpxrefr
   SET (status_a1, status_a2, status_a3, status_s1, status_b1, status_b2, status_me) = 
    ('NA', 'NA', 'NA', 'NA', 'NA', 'NA', 'NA'),
    xr_stock_no = NULL
WHERE xr_user_id = '$__XATTR_BATCHID__;';</extension>
  </attributes>
</action>

Possible Errors

Action does not specific a dataSource parameter

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc71-py2.6.egg/coils/logic/workflow/services/process.py", line 592, in work
    action_name, description = self.run_stanza( action_uuid )
  File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc71-py2.6.egg/coils/logic/workflow/services/process.py", line 281, in run_stanza
    parameters=stanza.get('params'))
  File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc71-py2.6.egg/coils/core/context.py", line 530, in run_command
    command.run()
  File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc71-py2.6.egg/coils/core/logic/action.py", line 281, in run
    self.parse_action_parameters()
  File "/usr/lib/python2.6/site-packages/OpenGroupware-0.1.49rc71-py2.6.egg/coils/logic/workflow/actions/sql/execute.py", line 54, in parse_action_parameters
    raise CoilsException('No source defined for executeAction')
CoilsException: No source defined for executeAction

Related

Wiki: OIESQLDataSources
Wiki: OpenGroupwareIntegrationEngine

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.