In a CL Program after executing a SQL SP how to receive a
Output value from the SP. Just to make it clear I am sending 2
input and 1 output parameter to the SQL Stored Procedure. Now
while receiving it output parm it is failing.



In a CL Program after executing a SQL SP how to receive a Output value from the SP. Just to make i..

Answer / Neena Pandey

In IBM i (AS/400), when executing a SQL Stored Procedure (SP) from CL, you can retrieve the output value by using the SQL command RETURNING INTO clause. However, the exact approach depends on whether your SP is declared as returning a scalar or table value.nFor a scalar value:n
DB2 EXEC SQL <your_sp> <input1>, <input2> RETURNING <output_column> INTO <local_variable>;nFor a table value:n
DB2 EXEC SQL DECLARE @return_table AS TABLE (n<output_column> INT);nDB2 EXEC SQL <your_sp> <input1>, <input2> RETURNING * FROM @return_table;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB400 Interview Questions

I have a PF with out any data but the dependent LF is having data?

1 Answers   HCL,


How can we handle errors in RPG?

4 Answers  


What is open data path? And what is the difference between access path and open data path?

1 Answers  


can any one tell me what is meant by PSSR? Kindly elaborate it...

1 Answers  


Suppose I have a pf, it contains 5 members, how to access particular member data from logical file? What is the use of member in pf?

1 Answers  


how to eliminate the level check error

2 Answers   TCS,


How to retrieve a physical file after deleting that?

1 Answers  


YOU CAN DELETE THE RECORD SPACE PERMENANTLY IN PHYSICALFILE THROUGH CL?

4 Answers  


what is the intractive job? what is the batch job ? how to change the batch job to interactive job?

2 Answers   Four soft,


what is dynslt and why we use that command when do we use command

2 Answers   Active Brains, UHG,


how can we write LF using flatfile.

9 Answers  


Last statement of any RPG pgm is LR?

5 Answers  


Categories