Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Proc. Question
>Okay, I got three yes answers but no clues as to how?
>
>Can anyone offer additional help?
>
>--
>smetro_at_world.std.com
Here is a sample of using cursors in a procedure. You must use a cursor
because there are no other ways of handling the situation of a SELECT clause
that returns multiple rows.
BEGIN
--and here is how to handle multiple rows of a cursor --FOR-LOOP starts with the first row of the SELECT clause returns --and loops until every row is handled
v_cust_name_1 := v_cust_name_1 || rec1.cust_name_1 || ' ' || rec1.cust_name_2 || '\n';
END LOOP;
DBMS_OUTPUT.PUTLINE('CUST_NAME_1 = ' || v_cust_name_1);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
>>S Metro wrote:
>>
>>> In MS SQL Server it is possible to write a stored procedure that consists
>of
>>> a SELECT statement that returns multiple rows.
>>>
>>> Is this possible in Oracle 7.3x?
>>>
>>> Thanks,
>>> Scott
>>>
>>> --
>>> smetro_at_world.std.com
>>> (take out nospam if replying via email)
>>
>
>
Received on Fri Sep 25 1998 - 14:36:45 CDT
![]() |
![]() |