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

Home -> Community -> Usenet -> c.d.o.tools -> IGNORE my update problem

IGNORE my update problem

From: Ralf Bender <ralf_bender_at_web.de>
Date: 11 Apr 2001 22:57:07 +0200
Message-ID: <3ad4c523@netnews.web.de>

hello

ignore my question! someone create the field kto_nr_auftrg as number, so i understand why it won't work ......
and yes, i will find the lpad function, too. no comment, please.

ralf

"Ralf Bender" <ralf_bender_at_web.de> wrote:
>hello
>
>
>i want to update many records with pl/sql statement. KTO_NR_AUFTRG is a CHAR
>Field. I want to set all with trailing '0' until Field length = 10 and commit
>every 2000 records, because there too much records, so it will run into rbs
 error.
> here is my statement, but it won't update anything:
>
>
>declare
> i number := 0;
> cursor s1 is SELECT * FROM tbl_belege
> WHERE length(KTO_NR_AUFTRG) < 10
> FOR UPDATE;
>begin
> for c1 in s1 loop
> update tbl_belege
> set KTO_NR_AUFTRG = ltrim(rtrim(to_char(to_number(c1.
>KTO_NR_AUFTRG),'0999999999')))
> where current of s1;
> i := i + 1; -- Commit after every X records
> if i > 1000 then
> commit;
> i := 0;
> end if;
>
>
> end loop;
> commit;
>end;
>/
>
>
>a select :
>select ltrim(rtrim(to_char(to_number(KTO_NR_AUFTRG),'0999999999')))
>from tbl_belege
>
>
>will bring all what i want to have...
>
>
>what's wrong???
>
>
>thx
>
>
>ralf
>
>--
>_____________________________________________________________
>NewsGroups Suchen, lesen, schreiben mit http://netnews.web.de
 

-- 
_____________________________________________________________
NewsGroups Suchen, lesen, schreiben mit http://netnews.web.de
Received on Wed Apr 11 2001 - 15:57:07 CDT

Original text of this message

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