Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Returning ResultSet from SQLJ stored procedures
I'm in the process of migrating some SQLJ stored
procedures from DB2 to Oracle 8.1.5. A number of
these return ResultSets. Enclosed is a sample
procedure.
#sql iterator HostTest_Cursor1 ( short );
public class HostTest
{
public static void getHostId (String ipAddr, ResultSet[] rs)
throws SQLException, Exception
{
HostTest_Cursor1 cursor1 = null; #sql cursor1 = { SELECT HOST_ID FROM HOSTS WHERE ( ( IP_ADDRESS = :ipAddr ) ) }; rs[0] = cursor1.getResultSet();}
What is the best way of defining this procedure using the CREATE PROCEDURE statement? I have successfully created this procedure within a package, but then had run-time errors regarding the second parameter.
Enclosed are the statements that I have used to create the procedure:
create or replace package hostpkg as
type host_curtype is ref cursor; procedure get_host_id(ipaddr in varchar2, rs out
procedure get_host_id(ipAddr in varchar2, rs out host_curtype) is language java name 'HostTest.getHostId(java.lang.String, java.sql.ResultSet[])';
Thanks,
Neil.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Tue Sep 21 1999 - 07:51:52 CDT
![]() |
![]() |