EXEC_SP Action
This action allows execution of a database stored procedure. You can initialise input parameters of the stored procedure with rule expressions and you can also capture the output parameters of the stored procedure in the attributes of business objects. If the stored procedure returns a “result set” (the result of the SQL SELECT statement) you can capture returned records as instances of business objects, which can then be placed in the Context or returned by a query. The stored procedure can be in the native Aware IM database or in the external database.
For detailed description of the syntax of this action refer to the Rule Language Reference Guide. Here we just provide a few examples:
EXEC SP ‘procAlertGetAll’ RETURN Alert
This stored procedure does not require any parameters. It “selects” all alert records in the native database, that Aware IM will automatically convert to instances of the Alert object and put in the context or make available for a query
EXEC SP ‘procAlertGet’ WITH ‘@alerID’=1 RETURN Alert
This stored procedure returns alert record with id=1
EXEC SP ‘procAlertGet’ WITH ‘@alerID’=SPParam.AlertId RETURN Alert
This stored procedure returns alert record with id taken from the AlertId attribute of the SPParam object
EXEC SP ‘procAlertGetOut’ WITH ‘@alerID’=SPParam.AlertId,’@alertName’=SPParam.AlertName OUT
This stored procedure returns alert record with id taken from the AlertId attribute of the SPParam object. The name of the alert is then written into the AlertName attribute.
EXEC SP ‘proc1’ OF SQLServer WITH ‘@param1’=1,’@param2’=2 RETURN SomeObject
This stored procedure returns the specified records from an external database identified by the name SQLServer.