title: Return table from function in Oracle
body: <p>Following function works with SQL Server.</p>
  
  <pre><code>CREATE FUNCTION GET_EMP_PROB_START_ATT_CODE(@EVAL_TYPE VARCHAR(6))
  RETURNS @EMP_PROB_START_ATT_CODE TABLE (   
     PROBATION_START_ATT_CODE varchar(6) NULL
  ) 
  AS
  BEGIN
  IF @EVAL_TYPE='New'
      INSERT INTO @EMP_PROB_START_ATT_CODE (PROBATION_START_ATT_CODE)
     SELECT NEW_EMP_PROB_START_ATT_CODE FROM HS_HR_PEA_DYNAMIC_ATTRIBUTES;         
     ELSE  
     INSERT INTO @EMP_PROB_START_ATT_CODE (PROBATION_START_ATT_CODE)
     SELECT EXIS_EMP_PROB_START_ATT_CODE FROM HS_HR_PEA_DYNAMIC_ATTRIBUTES;       
  RETURN;   
  END;
  </code></pre>
  
  <p>I just want to convert this to Oracle equivalent query . Tried but not succeeded.</p>
  
  <pre><code>CREATE FUNCTION GET_EMP_PROB_START_ATT_CODE(EVAL_TYPE VARCHAR(6))
  RETURN EMP_PROB_START_ATT_CODE  IS TABLE    
     PROBATION_START_ATT_CODE VARCHAR(6) NULL;
  
  AS
  BEGIN
  IF EVAL_TYPE='New'
      INSERT INTO EMP_PROB_START_ATT_CODE (PROBATION_START_ATT_CODE)
     SELECT NEW_EMP_PROB_START_ATT_CODE FROM HS_HR_PEA_DYNAMIC_ATTRIBUTES;         
     ELSE  
     INSERT INTO EMP_PROB_START_ATT_CODE (PROBATION_START_ATT_CODE)
     SELECT EXIS_EMP_PROB_START_ATT_CODE FROM HS_HR_PEA_DYNAMIC_ATTRIBUTES;       
  RETURN;   
  END;
  </code></pre>
  
  <blockquote>
    <p>Warning: compiled but with compilation errors</p>
  </blockquote>
  
  <p>Any help guys..</p>