Re: How to handle return type of Table%RowType in Store Procedure by JDBC

From: Rui Rosa Mendes <rrm_at_midialog.pt>
Date: 2000/07/07
Message-ID: <beh95.38$_w1.1510_at_nreader1.kpnqwest.net>#1/1


See this URL - http://osi.oracle.com/~tkyte/ResultSets/index.html  Rui Rosa Mendes
 rrm_at_midialog.pt

[Quoted] "Dickie Siu" <y94chsiu_at_netvigator.com> wrote in message news:8k2989$f506_at_imsp212.netvigator.com...
> Hi,
> I Got a Function which return row of table,
> is it possible to retrieve those return into a ResultSet ?
>
> OracleCallableStatement l_stmt = (OracleCallableStatement)
> connection.prepareCall("{ call ?:=GET_HOTELS(?) }");
>
> l_stmt.registerOutParameter(4, ??? ,???);
> ^ ^
>
> What I should put in above parameters???
> There is no OracleType.RowType!!
>
> ======== Store Procedure Code ===============
> create or replace
> function get_hotelS(pi_id in number)
> return hotels%rowtype
> is
> cursor cr_hotels is
> select ID
> ,NAME
> ,LOCATION
> ,ADDRESS
> ,CTY_ID
> ,PHONE
> ,FAX
> ,PHOTO_FILENAME
> ,HOTEL_URL
> ,HOC_CODE
> ,HOTEL_AIRPORT
> ,ADDRESS2
> ,ADDRESS3
> ,ADDRESS4
> ,FINDATA_OK
> from hotels
> where id = pi_id;
> rec_hotels hotels%rowtype;
> begin
> open cr_hotels;
> fetch cr_hotels into rec_hotels;
> if cr_hotels%notfound then
> rec_hotels.ID := pi_id;
> rec_hotels.name := null;
> end if;
> close cr_hotels;
> return rec_hotels;
> end;
> /
>
>
>
Received on Fri Jul 07 2000 - 00:00:00 CEST

Original text of this message