I have a stored procedure similiar to an earlier developer. I want to return all rows back to a Java program without using OUT parameters. Can it be done like this? Any help would be appreciated. Thanks.

- pamdesign


CREATE OR REPLACE PROCEDURE empProc2
(empno IN NUMBER)
IS
BEGIN
DECLARE
no NUMBER(5);
name VARCHAR2(50);
CURSOR emp_cur IS
SELECT empno,name FROM emp where empno = v_empno;
BEGIN
OPEN emp_cur;
LOOP
FETCH emp_cur
INTO no,
name;
EXIT WHEN emp_cur%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(no||'|'||name);
END LOOP;
CLOSE emp_cur;
END;
END;
/