title: Oracle procedure compilation error
body: <p>DB Version : Oracle 11.2.0.2</p>
  
  <p>Scenario : Trying to automate creation of range partitions using a procedure. Below is the code for that. It gets created without any error. But when I execute, it throws an error. I think the values am passing to the variables are not right. I tried with various sql's but nothing worked.Can someone please help me with this procedure.</p>
  
  <pre><code>SQL&gt; CREATE OR REPLACE PROCEDURE MONTHLY_PARTITION as
    2
    3    v_partition_name varchar2(30);
    4    v_limit TIMESTAMP with local time zone;
  
    5    6  begin
    7
    8    select to_char(trunc(add_months(sysdate,1),'MM'),'MonYYYY')
    9    into v_partition_name
   10    from dual;
   11
   12    SELECT TO_TIMESTAMP(TO_CHAR(ADD_MONTHS(current_timestamp, 2), 'YYYYMMDD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS')  into v_limit from dual;
   13
   14  execute immediate 'ALTER TABLE TEST ADD PARTITION ' || v_partition_name || ' VALUES LESS    THAN (TIMESTAMP ' || v_limit || ')';
   15
   16  end;
   17  /
  
  Procedure created.
  
  SQL&gt; show errors
  No errors.
  SQL&gt;
  SQL&gt; exec MONTHLY_PARTITION;
  BEGIN MONTHLY_PARTITION; END;
  
  *
  ERROR at line 1:
  ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
  ORA-06512: at "MONTHLY_PARTITION", line 14
  ORA-06512: at line 1
  </code></pre>