title: Oracle SQL Create function or procedure returning a table
body: <p>In SQL Server, I can just use 'RETURNS TABLE' and it will do the job. But I can't find how to do the same in Oracle SQL</p>
  
  <p>I have the following SELECT statement that needs to be put in a function or procedure:  </p>
  
  <pre><code>SELECT a.CodAcord, a.Descr
  FROM FreqSoce f
  LEFT JOIN Acord a ON a.CodAcord = f.CodAcord
  WHERE f.codSoce = codSoce;
  </code></pre>
  
  <p><code>codSoce</code>  is an INTEGER IN parameter, and I need to return <code>a.CodAcord</code> and <code>a.Descr</code> as result from my function/procedure.<br>
  Is there a simple way to do this? Without having to deal with temp variables and/or advanced content...</p>
  
  <p><strong>EDIT:</strong> Aditional info:<br>
   - I need to return <code>a.CodAcord</code> and <code>a.Descr</code>, but when I did some research to know how to return more than one variable using SQL Functions or Procedures, all I could find was that this was only possible by returning a TABLE. If there's a way to return more than one item from a Function or Procedure, please let me know.<br>
   - The use of Functions or Procedures is strictly required.<br>
   - I'm using SQL Developer.  </p>