Home » SQL & PL/SQL » SQL & PL/SQL » execute procedure in SqlDeveloper which returns recordset
execute procedure in SqlDeveloper which returns recordset [message #228229] Mon, 02 April 2007 02:49 Go to next message
d17may
Messages: 4
Registered: April 2006
Junior Member
I have a procedure which returns recordset using ref cursor .I use it successfully from java .I want to know how to run this procedure from sqldeveloper or command prompt and see the results .My procedure is
....................
CREATE OR REPLACE PACKAGE BODY Employee_RefCur_pkg
AS
PROCEDURE EmployeeSearch(i_EName IN VARCHAR2,
o_EmpCursor OUT empcur)
IS
BEGIN
OPEN o_EmpCursor FOR
SELECT emp.empno, emp.ename, emp.job,
emp.sal, dept.dname, dept.loc
FROM emp inner join dept on emp.deptno=dept.deptno
where emp.ename =i_EName;
END EmployeeSearch;
END Employee_RefCur_pkg;
.................
Thanks
Re: execute procedure in SqlDeveloper which returns recordset [message #228230 is a reply to message #228229] Mon, 02 April 2007 02:53 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

from command prompt you need to create a variable of type refcursor .

var x refcursor
exec pack_name.proc_name('SCOTT',:X);



regards,


Re: execute procedure in SqlDeveloper which returns recordset [message #228244 is a reply to message #228230] Mon, 02 April 2007 04:13 Go to previous message
d17may
Messages: 4
Registered: April 2006
Junior Member
dhananjay wrote on Mon, 02 April 2007 13:23
hi,

from command prompt you need to create a variable of type refcursor .

var x refcursor
exec pack_name.proc_name('SCOTT',:X);



regards,




Thanks for you kind help .I successfully executed it in command prompt but when i execute it in sqldeveloper tool of oracle
SQLPLUS Command Skipped: var x refcursor;
Do you know how to execute it in sqldeveloper
Thanks
Previous Topic: how to find max if data type is varchar2
Next Topic: SQL
Goto Forum:
  


Current Time: Sat Dec 10 03:00:43 CST 2016

Total time taken to generate the page: 0.26055 seconds