Encountered the symbol ”END“ when expecting one of the following
<p>I am using Oracle Reports, but the issue is a plsql issue. I am accepting a parameter and if the paramter is equal to some value I want to transform it to null before it is passed into my function. This is my code, but I am getting the error </p>

<blockquote>
  <p>Encountered the symbol ”END“ when expecting one of the following: := .
  ( % ; The symbol ”;“ was substituted for ”END“ to continue. ”</p>
</blockquote>

<pre><code>function BeforeReport return boolean is
begin

    IF :MY_VAR = 'SOME_VALUE' THEN :MY_VAR := null END IF;

    my_fun(
    :MY_VAR
    );
  return (TRUE);
end;
</code></pre>

<p>The IF statement looks correct to me as IF condition THEN operation END IF; is closed properly. The function seems to be closed off, the return has a comma to end it and there is an end with a comma to close of everything. If I comment out the IF statement it compiles and works fine. What is the issue?</p>