title: How to execute PL/SQL Oracle in sqlplus?
body: <p>I have sp in oracle. My SP is shown below</p>
  
  <pre><code>create or replace
  
  PROCEDURE GETMONITORING
  (
  v_namabarang in varchar2 default null,
  v_JenisLayanan in varchar2 default null,
  cv_1 IN OUT SYS_REFCURSOR
  )
  AS
    v_where  VARCHAR2(200);
    v_Select VARCHAR2(200);
    v_from   VARCHAR2(200);
    v_final  VARCHAR2(200);
    v_result VARCHAR2(200);
  BEGIN
    v_Select:='select * ';
    v_from  :='from permohonan ';
    v_where :='where sysdate=sysdate ';
  
  IF nvl(length(v_namabarang),0) &lt;&gt; 0 then 
        v_Where := v_Where || ' AND namabarang like ''' || v_namabarang|| '%'' ';
    end if;
  
  IF nvl(length(v_jenislayanan),0) &lt;&gt; 0 then 
        v_Where := v_Where || ' AND jenislayanan like ''' || v_jenislayanan || '%'' ';
    end if;
  
    v_final :=v_select|| v_from|| v_where;
  
   dbms_output.put_line(v_result);
  
  END;
  </code></pre>
  
  <p>I tried to exec in sqlplus by</p>
  
  <pre><code>SQL&gt; var r refcursor;
  
  SQL&gt; exec getmonitoring('AC','1',:r);
  
  SQL&gt;print :r;
  </code></pre>
  
  <p>and the result is "ORA-24338": Statement handle not executed</p>
  
  <p>So, how I exec my SP in sqlplus ? Thanks</p>