If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > JDBC - Stored Proc

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-03, 07:58
pamdesign pamdesign is offline
Registered User
 
Join Date: Dec 2002
Posts: 3
JDBC - Stored Proc

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;
/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On