Execute Stored Procedure

**NOTE: This plug-in is deprecated and no longer recommended for use for sites running on Appian 22.1 or later. The functionality of this component is available in Appian without installing the plug-in. You can use a!executeStoredProcedureForQuery(), a!executeStoredProcedureOnSave(), or the Execute Stored Procedure Smart Service in Appian 22.1 or later.**

Overview

This plug-in provides a Smart Service and Function for executing stored procedures. The Smart Service can be used to execute stored procedures that modify data. Result sets are returned as CDTs. As custom functions cannot have side-effects, it must not be used to execute stored procedures that modify data. It is only safe to use the Smart Service with stored procedures that modify data. Following SQL Statements should not be used by the stored procedures executed with the function:

  • INSERT
  • UPDATE
  • DELETE
  • TRUNCATE
  • CREATE TEMPORARY TABLE
  • SELECT... INTO (when the input target is not an input or output variable)

Key Features & Functionality

  • Works with both complex and simple data types
  • Tested with: MySQL, SQL Server, and Oracle
  • See the instructions document provided with the download for an example and how to configure
  • (New) Total row count column added to trace log
Anonymous
Parents
  • Hi,

    We are facing some serious issue with the this smart service:

    We have an audit table is mssql which is capturing all the success and failure of the stored procedure.

    When we are executing the stored procedure using the smart service in our PM, on success the log is getting captured in the audit table but on failure when sp returns and error, in that scenario no log is getting captured in the audit table. Seems like Appian is rolling back the transactions for each failure because for example:

    Row 1 got inserted (on success)

    Row 2 got inserted first then got deleted (on failure)

    Row 3 got inserted (on success)

    Row 4 got inserted first then got deleted (on failure)

    I.e in the audit table primary key entries are like

    1&3 as 2,4 also got inserted but seems like they also got deleted. And this is happening for Every failed transaction, primary key generates and then the row of data gets deleted leaving the next entry for success to happen with the next primary key.

    So only on success of the smart service the data is getting inserted in the audit table. For every error received in the smart service from the sp, data is first getting inserted but then with roll back it. Is getting deleted

    Need urgent help

Comment
  • Hi,

    We are facing some serious issue with the this smart service:

    We have an audit table is mssql which is capturing all the success and failure of the stored procedure.

    When we are executing the stored procedure using the smart service in our PM, on success the log is getting captured in the audit table but on failure when sp returns and error, in that scenario no log is getting captured in the audit table. Seems like Appian is rolling back the transactions for each failure because for example:

    Row 1 got inserted (on success)

    Row 2 got inserted first then got deleted (on failure)

    Row 3 got inserted (on success)

    Row 4 got inserted first then got deleted (on failure)

    I.e in the audit table primary key entries are like

    1&3 as 2,4 also got inserted but seems like they also got deleted. And this is happening for Every failed transaction, primary key generates and then the row of data gets deleted leaving the next entry for success to happen with the next primary key.

    So only on success of the smart service the data is getting inserted in the audit table. For every error received in the smart service from the sp, data is first getting inserted but then with roll back it. Is getting deleted

    Need urgent help

Children