Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: fetching across cursors
Seems a bit strange!
Fetch out of sequence normally occurs when you specify the cursor 'for
update of'.
A bit of a guess but try sorting the cursor, so as to force the cursor to fetch all values before deleting rows.
BTW, you don't need the first begin in your code.
M
Doug Cowles wrote in message <377D856F.A47A4CB4_at_bigfoot.com>...
>I know we've been through this topic recently but I think this is an
>easy one.
>Following code - just an opern cursor deleting it's own rows and
>comitting,
>works on Oracle 8.0.5 and gives a Fetch Out of Sequence on 7.3.3.
>Does that make sense?
>Does Oracle 8 allow this type of thing? And, is it against ANSI
>standard?
>
>create table xyz (a NUMBER, b NUMBER)
>alter table xyz add constraint tyz primary key (a);
>(insert a handful of values)
>begin
>declare
>cursor c0 as select * from xyz
>begin
>for v in c0
> delete from xyz where a = v.a;
> commit;
>end loop;
>end;
>
>Fetch out of sequence on 7.3.3 - Procedure complete on Oracle 8.0.5
>(Things may be syntactically off a little bit, but you get the general
>idea)
>
Received on Mon Jul 05 1999 - 03:33:00 CDT