title: Create Fucntion returning Table in pl/sql
body: <p><code>TEMP</code> table:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Node</th>
  <th>Curr_Cnt</th>
  <th>Prev_Cnt</th>
  <th>Diff</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>First</td>
  <td>20</td>
  <td>40</td>
  <td>20</td>
  </tr>
  <tr>
  <td>Second</td>
  <td>30</td>
  <td>70</td>
  <td>40</td>
  </tr>
  </tbody>
  </table>
  </div>
  <pre><code>CREATE OR REPLACE FUNCTION NEW_FUNCTION
  RETURNS table
  IS
      c_rec TEMP%ROWTYPE;
      TYPE c_tab IS TABLE OF c_rec%TYPE INDEX BY PLS_INTEGER;
      l_c_tab c_tab;
  
  BEGIN
  SELECT * INTO c_tab FROM
  
  --**The below with clause starting from with returns the same table structure as above temp table**
  
  ( WITH batch_id_dtl AS
    (SELECT a.*,
      rownum rnum
    FROM
      (SELECT MIN(creation_date) min_cr,
        MAX(creation_date) max_cr,
        batch_id
      FROM oalterr.q_audit_results
      GROUP BY batch_id
      ORDER BY 1 DESC
      )a
      WHERE BATCH_ID &lt;= 251940
    ),
    curr_cnt AS
   ......rest of the code......
  );
  
  RETURN C_TAB;
  
  END NEW_FUNCTION;
  </code></pre>
  <p>The above function returns the following error:</p>
  <blockquote>
  <p>expression 'C_TAB' is inappropriate as the left hand side of an assignment statement.</p>
  </blockquote>
  <p>Can anyone please tell me what type should I add in return part and what am I doing wrong in the execution part between <code>begin</code> and <code>end</code>.</p>