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

Home -> Community -> Usenet -> c.d.o.server -> Cursor LOOP and Clob reinitializing

Cursor LOOP and Clob reinitializing

From: Jean-Michel Scheiwiler <scjm_at_cybercable.fr>
Date: 2000/05/16
Message-ID: <8fs6gu$1moj$1@news4.isdnet.net>#1/1

I've got 2 tables: MRF (id,clob_textR) and MXF(id,id2,clob_textX) Given 1 id in the MRF table, i want to append all the clob_text of MXF to the one in MRF:

Example:
MRF
1 yada
2 gee
MXF
1 1 yidi
1 2 go
2 1 cool
2 2 big

=>PROCESS=>

MRF
1 yada yidi go
2 gee cool big

I've got a cursor CCOM (for MXF):

flagfirst:='O';
FOR rec IN CCOMM LOOP

   IF flagfirst = 'O' THEN

        idT := rec.id;
       SELECT Clob_TextT INTO clob_tempo FROM MRF WHERE id=rec.id FOR
UPDATE;
       flagfirst := 'N';

  END IF;   IF idT != rec.id THEN
      UPDATE MRF SET Clob_TextT = clob_tempo WHERE id = rec.id ;
      NumT := rec.NumLieu;
     SELECT Clob_TextT INTO clob_tempo FROM MRF WHERE id=rec.id FOR UPDATE;
 END IF;   dbms_lob.append(clob_tempo, rec.Clob_textX);

END LOOP; The problem is that the process keep appending data from the beginning:
=> MRF

1 yada yidi go
2 yada yidi go gee cool big

How can I reinitialize the clob_tempo when the id change ? (i've made some tries but without any result )
Or is there another method to solve this problem ?

Thank you for any help Received on Tue May 16 2000 - 00:00:00 CDT

Original text of this message

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