title: PLSQL Function with For Loop
body: <p>The following plsql code is for finding a prime number.
  Whenever I run this code, I am getting following message:</p>
  
  <blockquote>
    <p>ORA-24344: success with compilation error**</p>
  </blockquote>
  
  <pre><code>create or replace function pf (x in number)
      return varchar2(25)
  as 
      f varchar2(25);
  begin
      for i in 2..round(sqrt(x))
      loop
          if x mod i = 0 then
              f := 'Is not a prime.';
          else 
              f := 'Is a prime.';
          end if;
      end loop;
  
      return f;
  end pf;
  /
  </code></pre>