This discussion is archived
2 Replies Latest reply: Apr 9, 2013 4:38 AM by FrançoisDegrelle RSS

funcionality of procedures and functions

newbi_egy Explorer
Currently Being Moderated
hi all ,
i do not see a diff between using a procedure or function , because the return statement is the same as the dbms......

what is the difference between :
create procedure hh is 
n number;  
begin 
select sal into n from emp where ename = 'SMITH' ; 
dbms_output.put_line(n) ; 
end ; 
and
create function hh return number is 
n number ; 
begin 
select sal into n from emp where ename = 'SMITH' ; 
return n ; 
end ; 
it is the same , then why pro and func ?
what things can i do with pro , and i can not with func , or vice versa ?

thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points