1. Home
  2. Using Warewolf
  3. Using Stored Procedures

Using Stored Procedures

Database connectors in Warewolf consume stored procedures and functions in your database server, so you can use them to either read or update your database tables.  To create a Connector to a database stored procedure so that it can be consumed inside a service:

  1. To start, create a new service by clicking the new service button in the toolbar.New Services Icon in Warewold
  2. Scroll down in the Tool Box until you find the Database category. Drag the database tool onto the design surface and connect it to the Start node.
    1. If you are creating a New connection, click the New button to create a new database source.
    2. If you are creating a New connection. On the New Database Source tab select the Type. Then add your Server and select the Authentication Type you need, and add your User credentials.
    3. The Test Connection button should be enabled, click it.
    4. If your connection is valid, select the Database you want to use from the drop down list. This database will be the source that you have created.
    5. Click Save Connection icon in the left hand menu and save your Source
  3. Navigate back to your service and open the database connector by double clicking the blank area at the top of the tool. Select a Source from the Source drop down
  4. After you have selected the source, the Action list becomes populated with all of the stored procedures in your database. If you are working on the database at the same time, you can click the refresh button to refresh the list. Select an action from the list available by clicking on it. You can click the link under Provide Test Values to see the TSQL of the function or stored procedure. It is important to note at this point, that the Warewolf server is actually making the connection to the database server, so your Warewolf server must be able to access the database server.
  5. Add the Input [[variable]] or data value you want to use as input. This will be used at run time. To pass in Null when the value is empty, select Empty is Null.
  6. Click the Generate Outputs button
  7. In the Test data field, add the number of records you want to fetch, then click Test.
  8. Now click Done. You will be taken back to the expanded view of the Database Connector.
  9. Note the Recordset variable(s) in the Mapped To field of the Outputs. You will also see the same variable(s) in the Variables list. To rename the Mapped To outputs, simply replace the name in the Mapped To field and click Done.
  10. To not return a particular field, simply remove its name. It will not be mapped out.
  11. Click Done
  12. To reuse this one connector as a service in its own right, simply Save a workflow service with this as the only step.

Not what you were looking for? Ask our expert users in the Community Forum.

Updated on July 19, 2017

Was this article helpful?

Related Articles

Enjoying Warewolf?

Write a review on G2 Crowd