returning result set in procedure [message #2133] |
Sun, 23 June 2002 23:54 |
ga
Messages: 7 Registered: June 2002
|
Junior Member |
|
|
i'm new in using oracle. i'm having a hard time creating stored procedure which returns a complete result set:
in MS SQL Server:
create procedure get_list
as
select * from emp
the case here is that i want to retrieve all records in table emp. this is how i do it in MS SQL Server.
i try doing the same in Oracle:
create procedure get_list
is
begin
select * from emp;
end;
in doing this i get an error telling me that INTO is expected. can you help me on this? i'll appreciate
any help. thanks in advance.
|
|
|
Re: returning result set in procedure [message #2136 is a reply to message #2133] |
Mon, 24 June 2002 02:15 |
seng
Messages: 191 Registered: February 2002
|
Senior Member |
|
|
you need to construct SELECT statement as below
SELECT column INTO variable
FROM table
WHERE condition.
Note: This statement must not return more then a record if no then error message. For more then a record use cursor. for more information please refer to SQL,PL/SQL document. Hope this is helping
|
|
|
|