title: PLS-00103: ERROR.Encountered the symbol "BEGIN" when expecting one of the following: <an identifier> <a double-quoted delimited-identifier>
body: <p>I create a type:</p>
  
  <pre><code>CREATE OR REPLACE TYPE NAGULIVE.DEPOSIT_DATA_TYPE AS OBJECT (
    DEPOSIT_NO VARCHAR2 (16 Byte),
    ACCT_NAME VARCHAR2 (128 Byte),
    DEPOSIT_DT DATE,
    EPOSIT_AMT NUMBER (16,2)
  );
  </code></pre>
  
  <p>If I execute the function it will show error. I don't know where I'm wrong.</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION NAGULIVE.GET_DEPOSIT_DETAIL (IN_F_DATE DATE,IN_T_DATE DATE)
  RETURN(NAGULIVE.DEPOSIT_DATA_TYPE) AS
  BEGIN
      RETURN QUERY(SELECT D.DEPOSIT_NO, ACCT_NAME, DEPOSIT_DT, DEPOSIT_AMT 
          FROM DEPOSIT_ACINFO D 
          INNER JOIN ACT_MASTER  A ON D.CUST_ID=A.CUST_ID 
          INNER JOIN DEPOSIT_SUB_ACINFO DS ON D.DEPOSIT_NO=DS.DEPOSIT_NO WHERE DS.DEPOSIT_DT&gt;=IN_F_DATE  AND DS.DEPOSIT_DT&lt;=IN_F_DATE); 
          END;
          /  
  </code></pre>
  
  <p>The error is </p>
  
  <pre><code>2/7     PLS-00103: Encountered the symbol "(" when expecting one of the following:
            &lt;an identifier&gt; &lt;a double-quoted delimited-identifier&gt; self
            long double ref char time timestamp interval date binary
            national character nchar
  4/1     PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
            &lt;an identifier&gt; &lt;a double-quoted delimited-identifier&gt;
  </code></pre>