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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SELECT INTO

Re: SELECT INTO

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 2000/05/05
Message-ID: <8euphk$2je$1@nnrp1.deja.com>#1/1

In article <3912E803.F12298AF_at_fast.no>,
  kev <kevin.porter_at_fast.no> wrote:
> Hi,
>
> How do I use SELECT INTO?
>
> I couldn't find an explanation on Oracle's site, please could someone
> give me a URL.
>
> thanks,
>
> - Kev
>
>

select ... into ... from ...

is used to fetch AT LEAST one row and AT MOST one row from a query. It is shorthand for:

open C;
fetch C into ....;
if ( sql%rowcount = 0 ) then ERROR;
fetch C into ....;
if ( sql%rowcount <> 0 ) then ERROR;
close C;

support for the INTO clause in a select is language/environment dependent (eg: you would not use INTO in SQLPlus directly from a select but you might use INTO in sqlplus inside a plsql block).

--
Thomas Kyte                              tkyte_at_us.oracle.com
Oracle Service Industries
http://osi.oracle.com/~tkyte/index.html
--
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri May 05 2000 - 00:00:00 CDT

Original text of this message

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