Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ROWNUM
Any select into results in two fetches!
The first to trap no_data_found
the second one to trap too many rows,as a select into always returns 1 row.
So using 'and rownum = 1' is a method to suppress the too many rows message,
hence to suppress data problems.
In my current project I'm working with inherited code where this construct
is sprinkled all of the place.
Of course, disaster already did strike!
Fortunately the death penalty doesn't exist here any more.
Just to warn you: DON"T USE IT!!!
Hth,
Sybrand Bakker, Oracle DBA
"deana strbevski" <deana.strbevski_at_ina.hr> wrote in message
news:3A82900B.FF08294F_at_ina.hr...
> I wonder if select
>
> select a into :b
> from tab
> where cond and ROWNUM = 1;
>
> goes twice ? 1. to get first row
> 2. to see if any rows left
>
Received on Thu Feb 08 2001 - 11:54:09 CST