title: how to get names of partition in oracle while i input a date
body: <p>I have a table with many partitions range. I need to get the name of all partition when I give a date.
  For eg: if I input date 20/09/2014, it should list all partitions before that given date.</p>
  
  <pre><code>create or replace function get_part_name(p_date in date)
  return varchar2 is
  d date;
  retp varchar2(30);
  mind date:=to_date('4444-01-01','yyyy-mm-dd');
  str varchar2(32000);
  cursor c is
  select high_value, partition_name p
    from user_tab_partitions
   where table_name='TEST';
  begin
    for r in c loop
       str := r.high_value;
       execute immediate 'select '||str||' from dual' into d;     
       if p_date&lt;d and d&lt;mind then
          retp:=r.p;
          mind:=d;
       end if;
    end loop;
    return retp;
  end;
  </code></pre>
  
  <p>This is returing a single date. I need all the dates, is it possible?</p>