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 -> Script now longer stops in 9i

Script now longer stops in 9i

From: timberland_11 <timberland_11_at_yahoo.com>
Date: 22 Jan 2004 04:43:13 -0800
Message-ID: <18019e70.0401220443.56ac3130@posting.google.com>


I have been running the following script in oracle 7.3 and its was working fine now we have moved to Oracle 9i the scripts never seems to end (have to kill the process) is it something to do with how 9i treats null values… HELP

DECLARE
cursor BedCur(ADate DATE) Is
select a,b, sum(c)

   from X
   where
   (( trunc(a.date_out) <= ADATE

   AND trunc(a.date_out) >= ADATE)
   OR (trunc(a.date_in) <= ADATE
   AND trunc(a.date_in) >= ADATE)
   or (trunc(a.date_in) < ADATE
   and trunc(a.date_out) > ADATE)
   OR (trunc(a.date_in) <= ADATE
   AND trunc(a.date_out) is null))
   GROUP BY a,b,c
CurDate 		Date; 
processed_rows 		NUMBER(12) := 0;
total_processed_rows 	NUMBER(12) := 0;
rows_updated   		NUMBER(12) := 0;

BEGIN
CurDate:='&DateFrom';
while CurDate<='&DateTo' Loop for Row IN BedCur(CurDate) Loop Insert Into XC (site,bedday,Qty)

         Values(CurDate,Row.a,Row.b,Row.c);
end loop; Received on Thu Jan 22 2004 - 06:43:13 CST

Original text of this message

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