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 -> Help on simple script

Help on simple script

From: Richard Nield <richard.nield_at_ntlworld.com>
Date: Sun, 30 Dec 2001 21:02:26 -0000
Message-ID: <RoLX7.17344$4x4.1948134@news2-win.server.ntlworld.com>

Hi - I know it's Christmas, but could some one please help me with the simple script below. it seemed to work ok on the test db, but on live I got a no data found error...any tips would be gratefully received! The ITEMS table contains about one million items, the cursor retrieves about 1078.  thank!

declare

V_SMBI items.smbi%TYPE;
V_SMBS items.smbs%type;

cursor invalid_items_cur is

  select dmc, nc,iin
  from temp_items
  where record_id in (select record_id from validation_exceptions

                      where exception_id = 4);

  invalid_items_rec     invalid_items_cur%ROWTYPE;

BEGIN
 FOR invalid_items_rec in invalid_items_cur LOOP

 SELECT SMBI, SMBS INTO V_SMBI, V_SMBS
 from ITEMS
 where dmc = invalid_items_rec.dmc
 and nc = invalid_items_rec.nc
 and iin = invalid_items_rec.iin;

 UPDATE TEMP_ITEMS
 SET SMBI = v_SMBI,
 SMBS = v_SMBS
 where dmc = invalid_items_rec.dmc
 and nc = invalid_items_rec.nc
 and iin = invalid_items_rec.iin;

 END LOOP;
 END;
/ Received on Sun Dec 30 2001 - 15:02:26 CST

Original text of this message

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