Home » Developer & Programmer » Forms » How to execute a stored procedure with out parameter. (Oracle DB 10g, Windows Xp)
How to execute a stored procedure with out parameter. [message #461213] Thu, 17 June 2010 02:06 Go to next message
mahmud732
Messages: 82
Registered: October 2009
Location: Dhaka
Member
I have created a procedure like this

CREATE OR REPLACE PROCEDURE SCOTT.GetEmpList(p_recordset OUT SYS_REFCURSOR) AS
BEGIN
OPEN p_recordset FOR
SELECT * FROM scott.emp
WHERE deptno=10;
END GetEmpList;

Now i would like to execute this procedure in sqlplus which will display the following:

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 6/9/1981 2450 10
7839 KING PRESIDENT 11/17/1981 5000 10
7934 MILLER CLERK 7782 1/23/1982 1300 10

Please help me anyone.


Regards

Mahmud
Re: How to execute a stored procedure with out parameter. [message #461214 is a reply to message #461213] Thu, 17 June 2010 02:12 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
you meant you want to execute the procedure?


You can do this way if you are using sqlplus
sql> set serveroutput on
sql> variable rc refursor;
sql> exec GetEmpList(:rc);
sql> print :rc



Regards
Ved

[Updated on: Thu, 17 June 2010 02:12]

Report message to a moderator

Re: How to execute a stored procedure with out parameter. [message #461218 is a reply to message #461214] Thu, 17 June 2010 02:31 Go to previous messageGo to next message
mahmud732
Messages: 82
Registered: October 2009
Location: Dhaka
Member
Thanks for the quick reply.
I got the result.
Now i want to display into form executed by procedure when called.
How it possible.
Please Help
me.
Re: How to execute a stored procedure with out parameter. [message #461225 is a reply to message #461218] Thu, 17 June 2010 02:52 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Don't know how to display REF_CURSOR output on form.
Normally, you can do this by calling function from SELECT.
And you can not call PROCEDURE from SELECT.

regards,
Delna
Re: How to execute a stored procedure with out parameter. [message #461229 is a reply to message #461225] Thu, 17 June 2010 03:16 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I know that you can create a data block based on a procedure; I did that - returned a PL/SQL (index-by) table from a procedure to a form. I have never, though, returned a ref cursor. Perhaps you might try.
Re: How to execute a stored procedure with out parameter. [message #465019 is a reply to message #461229] Mon, 12 July 2010 03:32 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sorry that I have been so long in replying. Have you solved your problem?

David
Previous Topic: OLE Concepts in oracle Forms D2K
Next Topic: Format Mask to Char Field
Goto Forum:
  


Current Time: Fri Sep 20 04:44:40 CDT 2024