Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How Do You Get Result Sets in Oracle8 SPs?
In article <7cpd2d$prn$1_at_camel25.mindspring.com>,
"dhmac" <dhmac_at_JUSTREMOVETHISmy-dejanews.com> wrote:
> I'm working on a project that is converting from Sybase to Oracle8. In
Sybase,
> the project uses numerous stored procedures to encapsulate all of the select
> statements. Now I've been told that Oracle SPs don't support result sets. I
> know Oracle7 cannot do it but was this ability added to Oracle8? If not, is
> there an easy way to simulate this in Oracle8?
>
> Thanks
>
>
In Oracle8 you can define a type REF CURSOR with the following syntax: TYPE type_name IS REF CURSOR RETURN table_name%ROWTYPE; then you can define a stored procedure that returns this REF cursor as follows: PROCEDURE proc_name(search_key IN CHAR, rset OUT type_name) IS BEGIN OPEN rset FOR SELECT * FROM table_name WHERE key_col = search_key; END; when this procedure is called it will return rset in the OUT parameter which may be used in a Java program using JDBC or an OCI program.
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sun Mar 28 1999 - 18:07:44 CST
![]() |
![]() |