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: SQL-02112 SELECT ... INTO returns too many rows --- how to use the SELECT_ERROR option??

Re: SQL-02112 SELECT ... INTO returns too many rows --- how to use the SELECT_ERROR option??

From: Dave Sutton <dpsutton_at_marchsystems.co.uk>
Date: Tue, 9 Jan 2001 18:47:12 -0000
Message-ID: <93flto$s92$1@newsreaderg1.core.theplanet.net>

Thanks very much for this.

I've been able to use this method on most of my queries but on some the ordering is critical and the ROWNUM kicks in before the ordering is taken into account.

Any further ideas??

Dave

"Todd Barry" <toddbarry_at_earthlink.net> wrote in message news:qglm5tge3nc0oipoinr44ctli3nitp3s8m_at_4ax.com...
> >I'm getting the following error when executing one of my stored
 procedures:
> >
> >SQL-02112 SELECT ... INTO returns too many rows
> >
> >I just require the first record that is returned by the select statement
 and
> >wish to discard the rest.
>
> Just add on the ROWNUM qualifier:
>
> select col1
> into var1
> from table1
> where col2 = something
> and rownum = 1;
>
> -Todd
Received on Tue Jan 09 2001 - 12:47:12 CST

Original text of this message

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