Consider the stored procedure spSample2. The arguments can be specified in the following format:
Format 1:
- In a stored procedure:
SET AppVar2 = 30 + AppVar3; SET AppVar3 = 40; CALL spSample1(:AppVar1, :AppVar2, :AppVar3);
- In a C program using embedded SQL:
AppVar2 = 30 + AppVar3; AppVar3 = 40; EXEC SQL CALL spSample1(:AppVar1, :AppVar2, :AppVar3);
The values specified for AppVar2 and AppVar3 are passed as arguments to p2 and p3, respectively. When the stored procedure execution completes, the output parameter values are returned in AppVar1 and AppVar2. ACTIVITY_COUNT is set to 1.
Format 2:
- In a stored procedure:
SET AppVar2 = 30 + AppVar3; SET AppVar3 = 40; CALL spSample1(:AppVar1, :AppVar2, :AppVar3 + 3);
- In a C program using embedded SQL:
AppVar2 = 30 + AppVar3; AppVar3 = 40; EXEC SQL CALL spSample1(:AppVar1, :AppVar2, :AppVar3 + 3);
The values for p2 and p3 are AppVar2 and (3 + AppVar3), respectively. When the stored procedure execution completes, the output parameter values are returned in AppVar1 and AppVar2. ACTIVITY_COUNT is set to 1.