Adding a Stored Procedure Operation

You can create an operation for a stored procedure manually or by browsing for the procedures in a database.  Browsing is easier than creating it manually because information about the parameters, return value, and result sets can usually be retrieved from the database. Before you can browse a database to select a stored procedure for a database operation, you must configure an endpoint connection to provide access to the database.

When you add a stored procedure operation to a service, you are setting up that service to invoke a database stored procedure, which is a pre-defined statement or set of statements in a database. The operation has parameters that match the stored procedure parameters, a return value if the stored procedure has one, and results sets if the stored procedure returns them. The information you specify must match the actual inputs and outputs of the stored procedure.

Individual operations can be configured to enable or disable transaction autocommit. The autocommit setting controls whether the operation causes a transaction to be automatically committed. If the checkbox is selected, all database calls are completed in a separate transaction so that a business process rollback does not result in a database transaction rollback. If the checkbox is not selected, a business process rollback results in rollback of the database transaction. Set the checkbook on Operation Type to true for backward compatibility.

You must specify the following when you create an operation for a stored procedure:

The inputs and outputs of a stored procedure operation appear as an XML schema in the database service that contains the operation. The parameters, return value, and result sets that you specify for the operation appear as parts of the schema. The schema is used when you create a service interaction for the operation and add it to a business process.

Unlike the manual work required for adding a SQL statement operation, the wizard provides a list of available procedures. For some databases, the wizard provides parameters, result sets, and columns for the one result set. For procedures that do not automatically populate the Result Set, use the Discover result sets... button on the Result Set page of the wizard.

Stored Procedure Parameters

Parameter

Description

Name

User defined.

Number

The order of the parameters. You cannot edit the number; the order must be the same as the order in the query.

DB Name

Must be the same as it appears in the SQL query.

Mode

Designates whether the parameter is an in, out, or in/out. If the value appears as unknown, you must set it to match the mode of the parameter in the stored procedure. The stored procedure text may be helpful in determining the mode for parameters marked unknown.

Nullable

Designates whether the parameter can be null.

Type

Designates the database data type, such as char, varchar, or binary.

Scale

The scale (places to the right of the decimal point) for decimal and numeric parameters.

 

Stored Procedure Result Sets

Using the New Service Wizard for a database service, find a stored procedure one of two ways: