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 -> Re: ROWNUM

Re: ROWNUM

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 8 Feb 2001 18:54:09 +0100
Message-ID: <95unou$ijioj$2@ID-62141.news.dfncis.de>

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

Original text of this message

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