Sample stored procedure

A sample stored procedure is provided for you. PL/I source code is provided for it. There is also a COBOL source code example if you want to create a sample stored procedure in COBOL.

Description

The sample stored procedure uses a table that is called SAMPLE.CITYTABLE and provides insert, select, and delete functions to manipulate the content of this table. Create this table as described in Creating the sample table if you want to use the sample stored procedure.

Parameters

The stored procedure receives three input parameters. The Function parameter specifies the requested function and must be either Select, Insert, or Delete, or one of the abbreviations S, I, or D). The City and Country parameters are used as column values in the insert function or selection criterion in the select and delete function.

The stored procedure returns the output parameter Response, which contains information about the success of the function and it returns a result set with the selected rows, if the select function is used.

Sample code

Sample PL/I code is provided for the sample stored procedure. Sample COBOL code is also provided if you want to create a sample stored procedure for COBOL.