Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: add a new range partition in a existing table

Re: add a new range partition in a existing table

From: Carlos <miotromailcarlos_at_netscape.net>
Date: Wed, 17 Oct 2007 14:25:21 -0000
Message-ID: <1192631121.664584.41350@y27g2000pre.googlegroups.com>


On 17 oct, 15:49, sansar <uemit.uen..._at_googlemail.com> wrote:
> Hallo !
> My PL/SQL -Script send me a Error-Message.
> I don't know how i find the error.
> i want add a new range partition in a existing table ?
>
> eclare
> v_date date;
> v_part varchar2(20);
>
> CURSOR context_date_cur IS
> Select distinct ext_frontend.context_date
> from ext_frontend;
>
> begin
> -- Test statements here
> IF NOT context_date_cur%ISOPEN
> THEN
> OPEN context_date_cur;
> END IF;
>
> LOOP
>
> FETCH context_date_cur into v_date;
> exit when context_date_cur%NOTFOUND;
> DBMS_OUTPUT.put_line(to_char(v_date));
> v_part :='part_'||(to_char(v_date));
> DBMS_OUTPUT.put_line(v_part);
> execute immediate 'alter table LOG_ANALYSE.FRONTEND_TAB
> add partition v_part
> values less than 1+to_date(v_date, DD.MM.YYYY); ';
>
> end loop;
> CLOSE context_date_cur;
>
> end;

Whithout error message, a shoot in the dark but...

Escape single ' characters for the date_format, perhaps?

values less than 1+to_date(v_date, ''DD.MM.YYYY'') ';

HTH Cheers.

Carlos. Received on Wed Oct 17 2007 - 09:25:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US