Stack Exchange
stored procedure always returns "Process exited" error always
I am working on a table structure similar to the below and trying to get the output as mentioned.

To acheive this, I written the below PL SQL procedure:
     CREATE OR replace PROCEDURE Sample_procedure
AS
  TYPE list_of_names_t
    IS TABLE OF emp.emp_index%TYPE;
  processedindexes LIST_OF_NAMES_T := List_of_names_t();
  flag             emp.emp_index%TYPE;
  CURSOR c1 IS
    SELECT *
    FROM   emp
    WHERE  Trim(emp_id) = 'AAAAA'
    ORDER  BY last_maint_ts ASC;
BEGIN
    dbms_output.Put('Entered the loop');

    FOR rec IN c1 LOOP
        SELECT emp_index
        INTO   flag
        FROM   emp
        WHERE  emp_id = rec.emp_id
               AND last_maint_ts > rec.last_maint_ts;

        IF flag IS NOT NULL THEN
          processedindexes.extend;

          Processedindexes(processedindexes.last) := flag;

          processedindexes.extend;

          Processedindexes(processedindexes.last) := rec.emp_index;

          dbms_output.Put('The indexes'
                          ||rec.emp_index
                          ||' & '
                          ||flag
                          ||'refer to same emp ID');

          exit;

          dbms_output.Put('received NULL');
        END IF;
    END LOOP;
END;  

1) Everytime, I run this i get the output as Process exited in sql developer, Any suggestion on this?
Note: I am new to PL SQL programming, please correct me if my approach of solving this is not right.

@lc. Thanks so much for formatting the question

open sqlplus and execute the following :-
set serveroutput on
exec Sample_procedure;

provided your procedure is compiling fine, it should display the output in dbms_output.put

Max, Thanks for the answer, I am not seeing any output but it compiles fine without any errors, can you please advice?

Is there any type of output that you can see in sqlplus (after executing the above) ?

Is it possible to change the first dbms_output.put to dbms_output.put_line and then execute the above steps again? (not sure if it will do any change but worth a shot). I read that put is considered obsolete now.
http://psoug.org/reference/dbms_output.html

Thanks so much, It is working now..I am closing this question.
