Return valuesStatus codesSome limitations exist on passing data, depending on the databaseimplementation, which are discussed throughout this chapter. Additionally, not allstored procedures send and receive data. For example, if you write a storedprocedure to rebuild a database index at the end of a session, you cannotreceive data, since the session has already finished.
For many stored procedures, you provide a value and receive a value in return.These values are known as input and output parameters. For example, a salestax calculation stored procedure can take a single input parameter, such as theprice of an item. After performing the calculation, the stored procedure returnstwo output parameters, the amount of tax, and the total cost of the item includingthe tax.The Stored Procedure transformation sends and receives input and outputparameters using ports, variables, or by entering a value in an expression, suchas 10 or SALES.
Most databases provide a return value after running a stored procedure.Depending on the database implementation, this value can either be user-definable, which means that it can act similar to a single output parameter, or itmay only return an integer value.The Stored Procedure transformation captures return values in a similar manner as input/output parameters, depending on the method that the input/outputparameters are captured. In some instances, only a parameter or a return valuecan be captured.If a stored procedure returns a result set rather than a single return value, theStored Procedure transformation takes only the first value returned from theprocedure.
An Oracle stored function is similar to an Oracle stored procedure, exceptthat the stored function supports output parameters or return values. In thischapter, any statements regarding stored procedures also apply to storedfunctions, unless otherwise noted.
Status codes provide error handling for the Integration Service during a workflow.The stored procedure issues a status code that notifies whether or not the storedprocedure completed successfully. You cannot see this value. The IntegrationService uses it to determine whether to continue running the session or stop. Youconfigure options in the Workflow Manager to continue or stop the session in theevent of a stored procedure error.
Connected and Unconnected