Friday, January 18, 2008

Oracle 10g: Executing Stored Procedure(Get)

SET SERVEROUTPUT ON SIZE 1000000
DECLARE
     v_cursor GetRefCodePckg.refcode_ref_cursor;
     v_typeid GBL_REFCODE.TYPEID%TYPE;
     v_parentid GBL_REFCODE.PARENTID%TYPE;
     v_typedescription GBL_REFCODE.TYPEDESCRIPTION%TYPE;
     v_typedetails GBL_REFCODE.TYPEDETAILS%TYPE;
     v_typestatus GBL_REFCODE.TYPESTATUS%TYPE;

BEGIN
     GetRefCodePckg.SP_GETREFCODE (P_ID => 1,
     DESC_REF => v_cursor);
     LOOP
     FETCH v_cursor
          INTO v_typeid, v_parentid, v_typedescription, v_typedetails, v_typestatus;
          EXIT WHEN v_cursor%NOTFOUND;
     DBMS_OUTPUT.PUT_LINE(v_typeid ' ' v_parentid ' ' v_typedescription ' ' v_typedetails ' ' v_typestatus);
     END LOOP;
     CLOSE v_cursor;
END;
/

No comments: