how to get a ref of a record???
From: deejay <djuravel_at_dgny.com>
Date: 1 Oct 2001 08:12:10 -0700
Message-ID: <f7b19882.0110010712.73c44386_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,xchgRef);
Date: 1 Oct 2001 08:12:10 -0700
Message-ID: <f7b19882.0110010712.73c44386_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 xchgRef REF xchg_objtyp;
2 begin
3 select REF (x) into xchgRef
4 from xchg_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. xchgRef is a java.sql.Ref object.
String queryTxt = "select REF (x) into ?
from xchg_tab x where x.cod like 'jj'";cstmt = conn.prepareCall(queryTxt);
cstmt.setRef(1,xchgRef);
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 Mon Oct 01 2001 - 17:12:10 CEST