Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Script now longer stops in 9i
"timberland_11" <timberland_11_at_yahoo.com> schrieb im Newsbeitrag
news:18019e70.0401220443.56ac3130_at_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;
--missing:
END;
/
(EOF) You only ended the loop. Received on Wed Jan 28 2004 - 06:44:43 CST