title: PL/Sql procedure vs function?
body: <p>I tried to looked in to difference between pl/sql procedure and function and found the link <a href="http://it.toolbox.com/blogs/oracle-guide/learn-plsql-procedures-and-functions-13030" rel="noreferrer">http://it.toolbox.com/blogs/oracle-guide/learn-plsql-procedures-and-functions-13030</a>. First let me tell you what a developer generally do with pl/sql procedure and function</p>
  
  <p>1) Wanted to get the some return value. He can acieve it with both function and procedure  .With function if he want to return a single value he can use return statement . If he want to return multiple values he can achieve it with inout parameter.Similarily he can get return value with inout parameter from procedure(not with return statement)</p>
  
  <p>But it does not make any difference to developer as long as he is able to achieve its intentention either with return statement or inout parameter.</p>
  
  <p><strong>so here also both can replace each other.</strong></p>
  
  <p>2) He can use DML  in both Function and procedure. So here also he can use either of these to change the state of databse.</p>
  
  <p><strong>So i dont get any concrete reasoning which one to use where as both can replace each other in some.</strong></p>
  
  <p>The only reasonable reason i found up to some extent is that Functions can be called from SQL, procedure cannot</p>
  
  <p>Could somebody explain which one to use when and why?</p>