Declaring Subprograms
You can declare subprograms in any PL/SQL subprogram, block, or package. But, you should declare subprograms at the end of the declarative part after all the other program items. For illustration, the procedure declaration below is misplaced:
DECLARE
PROCEDURE award_bonus (...) IS -- misplaced; must come last
BEGIN
...
END;
rating NUMBER;
CURSOR c1 IS SELECT * FROM emp;