Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to map an Oracle ROWTYPE to a java class with JDBC or SQLJ?

Re: How to map an Oracle ROWTYPE to a java class with JDBC or SQLJ?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 5 Oct 2001 09:47:05 -0700
Message-ID: <9pko6904nc@drn.newsguy.com>


In article <9pkftf$juu$1_at_newsg2.svr.pol.co.uk>, "Adam says...
>
>Folks,
>
>
>I need to call an Oracle 8.1.6 stored proc froma Java prog via SQLJ.
>The proc accepts 1 param, which the "%rowtype" of the table that it inserts
>into.
>
>Does anyone know how to map the "%rowtype" type to a Java class?
>
>I have looked through the SQLJ and JDNC docs, and it seems to deal with
>mapping every other oracle special type but %rowtype :-)
>
>
>Thanks in advance...
>
>
>Cheers - Adam
>
>
>

you cannot bind to a plsql record type from anything other then plsql. you'll need to execute a block like this:

declare

   l_rec T%rowtype;
begin

   l_rec.c1 := ?;
   l_rec.c2 := ?;
   l_rec.c3 := ?;

   proc( l_rec );
end;

and bind the individual components.

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Fri Oct 05 2001 - 11:47:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US