Today I oddly found the different between using non-cursor and cursor in Oracle. Generally, using these two usages are same but kind of different memory usage and error handling.
Advantage and disadvantage Of Cursor
Using so many cursors in stored procedures, functions and views can be high memory usage in Server. Because every cursors take individual space in memory while creating and processing. If return value is NULL from this cursor, Oracle will not throw error message to application.
Example coding of using cursor
(P_PERSON_ID IN NUMBER)
CURSOR C_PP (P_PERSON_ID NUMBER) IS
SELECT NAME FROM PERSON
WHERE PERSON_ID = P_PERSON_ID;
FETCH C_PP INTO L_MENU;
WHEN OTHERS THEN
L_ERR_MSG := SQLERRM;
CREATE OR REPLACE PROCEDURE PPS_TEST