I was writing a code asking me to use a anonymous block to execute a procedure. And when I run the code, it shows that there are few errors. However, the error messages are not very helpful regarding what went wrong. My first question is that if I want to use a cursor inside the procedure I call in the anonymous block, should I define my cursor inside the procedure or outside the procedure but inside the anonymous block? My second question is should I keep my exception inside the cursor loop? And other than that, what went wrong with my code? Thanks.
The error report looks like this: Error report - ORA-06550: line 12, column 15: PLS-00201: identifier 'ATERM' must be declared ORA-06550: line 13, column 10: PL/SQL: ORA-00904: : invalid identifier ORA-06550: line 11, column 7: PL/SQL: SQL Statement ignored ORA-06550: line 53, column 28: PL/SQL: ORA-00918: column ambiguously defined ORA-06550: line 33, column 10: PL/SQL: SQL Statement ignored 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error.