Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Return status of PLSQL procedure

934101Sep 3 2015 — edited Sep 3 2015

How I can return status of a procedure i.e. sucess or failure in PLSQL, please provide me some example.

CREATE OR REPLACE PROCEDURE Main (status OUT VARCHAR2)

IS
TYPE employees_aat IS TABLE OF employees%ROWTYPE;

l_employees employees_aat;
BEGIN
SELECT *
BULK COLLECT INTO l_employees
FROM employees
ORDER BY last_name DESC;

DBMS_OUTPUT.put_line (l_employees.COUNT);

FOR indx IN 1 .. l_employees.COUNT
LOOP
DBMS_OUTPUT.put_line (l_employees (indx).last_name);
END LOOP;
END;
/

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 1 2015
Added on Sep 3 2015
6 comments
736 views