Re: Can't create a simple select procedure

From: Nicky Taylor <nicky.taylor_at_gecm.com>
Date: Thu, 10 Dec 1998 09:33:39 +0000
Message-ID: <366F9573.32DE_at_gecm.com>


When you include a SELECT statement in a PL/SQL procedure you must include an INTO clause. For example to do this...

select column1
from mytable;

In a PL/SQL procedure you would do this...(assuming column1 is of NUMBER datatype)

declare
  v_column1 number;
begin
  select column1
  into v_column1
  from mytable;
end;

Of course there is the added problem that if the query returns more than one row this will throw up an error as well, which you would overcome by declaring a cursor to hold the query results;

Hope this helped! Received on Thu Dec 10 1998 - 10:33:39 CET

Original text of this message