A stored procedure is a group of SQL statements that form a logical unit and perform a particular task. Stored procedures are used to encapsulate a set of operations or queries to execute on a database server. Stored procedures can be compiled and executed with different parameters and they may have any combination of input, output, and input/output parameters.
The page guides you on how to create a stored procedure service in Adeptia Connect to retrieve a single value or a result set(s) generated by a stored procedure. You will also come to know when and how you can define the layout of a stored procedure in sections to follow.
Creating a stored procedure service
A stored procedure service in Adeptia Connect helps you retrieve the output generated by a stored procedure of a database. The output can be a single value retrieved in a context variable or multiple values retrieved as a result set in the form of an XML stream. Ensure that you you meet the following prerequisites before you start creating a stored procedure service.
Prerequisites
Database Info activity must be created before creating Stored Procedure activity.
Follow the steps below to create Stored Procedure service:
Click Configure > OTHERS>Stored Procedure.
Click Create Stored Procedure.
In the Name field, enter the name of the stored procedure service.
In the Description field, enter the description of the stored procedure service.
in the Database Info field, select the Database Info service.
Click hereto learn how to create Database Info activity.
Int the Select Schema field, select the schema.
The stored procedures associated with this schema are populated in the next field.
In the Select Stored Procedure field, select the stored procedure from the list.
Make sure that you have execute permissions on the database as only the procedures for which the database user has permission are shown on the Browse screen.
Select the required stored procedure and click the Get Parameters button. The Stored Procedure Parameter screen is displayed with list of parameters.
Click OK to return to the Stored Procedure activity screen. Parameters of the selected procedure are populated in Stored Procedure Parameters field.
The variables are automatically populated in the In Params, Out Params, and InOut Params fields, these fields are editable though. The @ symbol precedes the variable name in case of MS SQL database, however, for Oracle database @ symbol is not required.
Expand the Advanced Properties section and select the Project from Project drop-down list.