From: Thomas J. Kyte <tkyte@us.oracle.com>
Subject: Re: SELECT INTO
Date: 2000/05/05
Message-ID: <8euphk$2je$1@nnrp1.deja.com>#1/1
References: <3912E803.F12298AF@fast.no>
To: kevin.porter@fast.no
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
X-Http-Proxy: 1.0 x42.deja.com:80 (Squid/1.1.22) for client 205.227.43.12
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Fri May 05 15:32:02 2000 GMT
X-MyDeja-Info: XMYDJUIDtkyte
Newsgroups: comp.databases.oracle.misc


In article <3912E803.F12298AF@fast.no>,
  kev <kevin.porter@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@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.


