Calling Stored Procedure From Flow To Write Data

Last Updated: 05/02/2018 Introduced in Version: 2.0

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

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

Then, we select desirable table and click Next

addDb

We can skip next Add Views window by clicking Next.

 skipView

In the Procedures window we select our Stored Procedure and click Save.

 addStoredProc

Our database integration is added to the Decisions.

 dbAdded

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

 createFlow

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

 nameFlow

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

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

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

 provideWithData

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 Shot

debugFlow

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

 flowDebugged

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

 dataInserted

Additional Resources