Now V7R1 - Default parameter values are supported for both SQL and external stored procedures

Go down

Now V7R1 - Default parameter values are supported for both SQL and external stored procedures

Post  Archana K on Sun Jan 27, 2013 6:24 pm

With the delivery of Technology Refresh #5 for the IBM i 7.1 release, We can now have flexibility to minimize coding changes when deploying new versions of stored procedures. New default value support for parameters enables this flexibility. Default parameter values are supported for both SQL and external stored procedures. IBM plans to enable default parameter values for user-defined functions (UDFs) in a future release of the IBM i operating system.

This new ability to declare default parameter values enables developers to selectively choose which programs have to be modified to accommodate the new input parameters for a stored procedure. Deploying your upgraded stored procedures will go much faster when you can reduce the number of invoking programs that have to be changed.

Let's assume that the Generate_Claim stored procedure in Figure 1 was upgraded with two new parameters that allow the invoker to specify the department to process a claim and override the claim date.


(IN policyID CHAR(10),

IN claimDept CHAR(3) DEFAULT('45H'),




/* Logic goes here */


Once the upgraded version of the Generate_Claim procedure is deployed, existing programs will continue to work with the following SQL Call statement:

CALL Generate_Claim('AB12345678')

For this type of invocation, the stored procedure will use the default values of 45H and the current date during execution of the stored procedure.

If an invoker wanted to override the claim department, but not the claim date, the developer could use one of the following SQL Call statements to override the claims department while still using the default claim date value.

CALL Generate_Claim('AB12345678', '50A')

CALL Generate_Claim('AB12345678', '50A', DEFAULT)

This new support also makes it possible to override the claim date and still have the default value used for the claim department. This is done using the named parameter syntax shown in the following CALL statement. With named parameters, default values are used for any parameter that's not specified in the stored procedure invocation—in this example, that means the default value is used for the claim department input parameter.

CALL Generate_Claim('AB12345678', claimDate=>'10/12/2012')

Archana K

Posts : 76
Join date : 2013-01-27
Age : 27
Location : chennai

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum