HELP NEEDED WITH REF--desparate!!
From: deejay <djuravel_at_dgny.com>
Date: 11 Oct 2001 11:01:22 -0700
Message-ID: <f7b19882.0110111001.380be40e_at_posting.google.com>
Working with Oracle8i on Solaris, I need to obtain the Ref of a record when I query the database. I need to do this via java. I think I know how to do this in PL/SQL. First of all, can someone tell me if this is the proper way to do this in PL/SQL?
cstmt.setRef(1,myRef);
Date: 11 Oct 2001 11:01:22 -0700
Message-ID: <f7b19882.0110111001.380be40e_at_posting.google.com>
Working with Oracle8i on Solaris, I need to obtain the Ref of a record when I query the database. I need to do this via java. I think I know how to do this in PL/SQL. First of all, can someone tell me if this is the proper way to do this in PL/SQL?
SQL> declare myRef REF my_objtyp;
2 begin
3 select REF (x) into myRef
4 from my_tab x
5 where x.cod like 'dj';
6 end;
7 /
PL/SQL procedure successfully completed.
Secondly, How is this done in java. This is what I have so far. cstmt is a callable statement. myRef is a java.sql.Ref object.
String queryTxt = "select REF (x) into ?
from my_tab x where x.cod like 'dj'";cstmt = conn.prepareCall(queryTxt);
cstmt.setRef(1,myRef);
Before I even do an executeQuery, I get this error:
java.sql.SQLException: Invalid argument(s) in call.
What am I doing wrong?? How should this be done?
Thank you. Received on Thu Oct 11 2001 - 20:01:22 CEST