Calling Stored Procedure From Flow To Write Data
  • Updated on 17 Apr 2015
  • 2 minutes to read
  • Print
  • Dark
    Light

Calling Stored Procedure From Flow To Write Data

  • Print
  • Dark
    Light

This tutorial demonstrates how to add Stored Procedures while integrating with Database in Decisions . Next, we will call Stored Procedure from the Flow to write data to the Database we integrated with.

Example:
Note: go through the following document to avoid SQL Server Database Permissions errors: http://documentation.decisions.com/sql-server-database-permissions/
For our example we have a simple Database with a Stored Procedure that inserts a new row into the Database .
dbSample.png

To integrate with this Database in Decisions Portal we navigate to the System > Integrations > Databases and click Integrate With Database button on the Folder Actions Panel . In the resulting pop-up window we input connection details and click Next .
integrateWithDb.png

Then, we select desirable table and click Next ...
addDb.png{height ="312" width="812"}
We can skip next Add Views window by clicking Next .
skipView.png{height ="311" width="815"}
In the Procedures window we select our Stored Procedure and click Save .
addStoredProc.png{height ="293" width="795"}

Our database integration is added to the Decisions .
dbAdded.png

Next, we navigate to the Designer Folder and click Create Flow button from Folder Actions Panel.
createFlow3.png

In the resulting window we provide our Flow with the Name and click Create to proceed to the Flow Designer.
nameFlow12.png

In the Flow Designer we can locate a step that was generated for execution of the Stored Procedure under Integrations > My Integrations > Database > [Name] (Database) category. We add Exec dbo.InsertSampleDatabaseCurtis step to our Flow .
addExecStep.png

For the simplicity of this example we just connect both outcomes from Exec dbo.InsertSampleDatabaseCurtis step to the End step in our Flow . Next, we select Exec dbo.InsertSampleDatabaseCurtis step on the workspace and Step Information Layer pops-up. In this layer we can configure data that we would like to write to the database.
callStepInfoLayer.png

In this Example we simply use Constant data that will be inserted into the database.
provideWithData.png

Next, we close Step Information Layer and click Debug Flow link from the top panel in the Flow Designer to test our Flow .
Note that in Decisions version 3.5 and above, you'll need to click Test Flow to access this function.
3.5-Test-Flow-Shot10.png

debugFlow5.png

Debugger indicates that our Flow was executed successfully with no errors.
flowDebugged.png

If we check our Database we can confirm that our new row was added from the Flow .
dataInserted.png

Was this article helpful?