adspace
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.
Answer Posted / 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 View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category