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: SELECT INTO in SQL*Plus

Re: SELECT INTO in SQL*Plus

From: Remco Blaakmeer <remco_at_rd1936.quicknet.nl>
Date: 11 Jan 2000 02:36:29 GMT
Message-ID: <85e4vd$rob$1@rd1936.quicknet.nl>


In article <ed1s6sg1lpmb5ul92e2lhu2kkhoo135tg3_at_4ax.com>,

        Maxim Demenko <mdemenko_at_t-online.de> writes:

> On Tue, 28 Dec 1999 21:34:54 +0100, Cong TANG <lai-tang_at_mycity.at>
> wrote:
> 

>>SELECT ... INTO is a PL/SQL statement, hence must be part of a PL/SQL
>>block.
>>Example:
>>
>>SQL> variable x number;
>>SQL> begin
>> 2 select count(*) into :x
>> 3 from emp;
>> 4 end;
>> 5 /
>>
>>PL/SQL procedure successfully completed.
>>
> alternately this command works too:
> SQL>variable i number
> SQL>execute select count(*) into :i from dba_tables;

Yes, this exactly the same. "EXECUTE <whatever>;" sends the PL/SQL block "BEGIN <whatever>; END;" to the database.

Remco
--
rd1936: 3:30am up 2 days, 8:09, 10 users, load average: 4.10, 5.52, 5.71 Received on Mon Jan 10 2000 - 20:36:29 CST

Original text of this message

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