467,911 Members | 1,465 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,911 developers. It's quick & easy.

Parameter Store procedure

hi

can any one tell me how to run the store procedure where one of its parmeter has OUT and when i execute i want to get the values .

Its argent reply.
Apr 24 '07 #1
  • viewed: 1417
Share:
3 Replies
chandu031
Expert
Hi,

Here's an example:

declare count1 number;
begin
sample_procedure(count1);
dbms_output.put_line(count1);
end;
Apr 26 '07 #2
debasisdas
Expert 4TB
procedure
===========
CREATE OR REPLACE PROCEDURE PROC1(NUM NUMBER,NAME OUT VARCHAR)
IS
BEGIN
SELECT ENAME INTO NAME FROM EMP WHERE EMPNO=NUM;
END;
------------
execution
-------------------
declare
n varchar2(10);
begin
proc1(7788,n);
dbms_output.put_line(n);
end;




hope u find the trick
all the best
Apr 26 '07 #3
debasisdas
Expert 4TB
ex-2
-----------
Expand|Select|Wrap|Line Numbers
  1.  
  2. create or replace procedure testproc(no emp.empno%type,rec out emp%rowtype)
  3.  is
  4.  cursor c is select * from emp where deptno=no;
  5.  begin
  6.  open c;
  7.  loop
  8.  fetch c into rec;
  9.  exit when c%notfound;
  10.  DBMS_OUTPUT.PUT_LINE(rec.empno||'       '||rec.ename||' ' ||rec.job||' ' ||rec.sal);
  11.  end loop;
  12.  close c;
  13.  end ;
  14. -----------------------------------
  15. TO EXECUTE
  16. -----------------------------------
  17.  declare
  18.  r emp%rowtype;
  19.  begin
  20.  testproc(10,r);
  21.  end;
  22.  
  23.  


now try few more yourself
Apr 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Hugo Lefevre | last post: by
reply views Thread by kids_pro | last post: by
1 post views Thread by Hrvoje Voda | last post: by
1 post views Thread by Hrcko | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.