How to get the result from Procedure

oracleplsqlscriptingstored-procedures

How can i get my out parameters from my procedure.
My stl_mbc_cdr table has over 100 records and i cant see my results.

declare 
   call_charge VARCHAR(10);
   MSG_OUT     VARCHAR(50);
BEGIN
   FOR REC IN (SELECT *FROM dulguunbaatar.stl_mbc_cdr_1062) LOOP 
   pk_test_duba.recharge_idd(REC.Called_Number,
                               rec.call_date||rec.call_time,
                                                         rec.duration,
                                                         CALL_CHARGE,
                                                         MSG_OUT);      
    END LOOP;
end;

Best Answer

Depends on the client you're using really, but this should work in SQL*Plus, SQL Developer etc.

set serveroutput on;

declare 
   call_charge VARCHAR(10);
   MSG_OUT     VARCHAR(50);
BEGIN
   FOR REC IN (SELECT *FROM dulguunbaatar.stl_mbc_cdr_1062) LOOP 
   pk_test_duba.recharge_idd(REC.Called_Number,
                               rec.call_date||rec.call_time,
                                                         rec.duration,
                                                         CALL_CHARGE,
                                                         MSG_OUT);  
    DBMS_OUTPUT.PUT_LINE('charge: '||CALL_CHARGE||' message: '||MSG_OUT);    
    END LOOP;
end;