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

From: Dickie Siu <y94chsiu_at_netvigator.com>
Date: 2000/07/08
Message-ID: <8k54l6$8f51_at_imsp212.netvigator.com>#1/1


Is it mean that I cannot return rowType diretly, I must use cursor instead right?

Thanks!

Rui Rosa Mendes <rrm_at_midialog.pt> wrote in message news:beh95.38$_w1.1510_at_nreader1.kpnqwest.net...
> See this URL - http://osi.oracle.com/~tkyte/ResultSets/index.html
> Rui Rosa Mendes
> rrm_at_midialog.pt
>
> "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 Sat Jul 08 2000 - 00:00:00 CEST

Original text of this message