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 -> Newbie Cursor Question

Newbie Cursor Question

From: Keith <keith.wilby_at_baeAWAYWITHITsystems.com>
Date: Mon, 6 Jun 2005 10:54:47 +0100
Message-ID: <42a41b40$1_1@glkas0286.greenlnk.net>


What's wrong with this code? I want to be able to replace instances of the ampersand character with the string "AND" but this code seems to go into an end less loop and updates nothing. The query in the cursor works on its own so there must be something I'm missing with the loop.

Many thanks,
Keith.

declare

cursor c1 is

     select replace(ver_drg_title,chr(38),'AND')
     from oms_version_tbl
     where instr(ver_drg_title,'&',1,1)>0
     for update of ver_drg_title;

v_title oms_version_tbl.ver_drg_title%type;

begin

open c1;

     loop
          fetch c1 into v_title;
          exit when c1%notfound;
          update oms_version_tbl
          set ver_drg_title = v_title
          where current of c1;
     end loop;

close c1;

end; Received on Mon Jun 06 2005 - 04:54:47 CDT

Original text of this message

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