Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - Select 1 row only from a table.

Re: SQL - Select 1 row only from a table.

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 1 Apr 2004 09:09:25 -0800
Message-ID: <4b5394b2.0404010909.6d907d77@posting.google.com>


"Craig Burtenshaw" <crb_at_amsa.gov.au> wrote in message news:<406b8559$0$93305$c30e37c6_at_lon-reader.news.telstra.net>...
> Hi,
>
> Is there away of selecting records from a table using 'select (1) from table
> where column = x' and
> as soon as there one record (out of a possible 100), stop and give a
> response?
>
> Oracle 8.1.7.4
> Solaris 2.7
>
> Thank you
> Craig.

HOPEFULLY, you are doing this from a CURSOR in the application language, and you just want faster response? In that case, I think you want to use
 HINT FIRST ROWS
in the declaration of the cursor. Then you open, fetch the first row, and display your prompt to the user. Again assuming speedy response is what you want.

If you are looking for a YAVOR (Yet Another Variation On ROWNUM) query, you won't get help from me.

HTH,
  ed

Edward J. Prochak   --- Magic Interface, Ltd.
Ofc: 440-498-3700   --- 7295 Popham Place, Solon, OH 44139
on the web at       --- http://www.magicinterface.com
email: ed.prochak_at_magicinterface.com Received on Thu Apr 01 2004 - 11:09:25 CST

Original text of this message

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