0 pts.
 PL SQL Record in Java-2
Dear All I have a Stored Package written as follows: CREATE OR REPLACE PACKAGE firstPackage IS --Type definition TYPE sampleType IS RECORD ( name VARCHAR2(128), interface VARCHAR2(128), tablespc VARCHAR2(128) ); TYPE c_mx1_type IS REF CURSOR; --procedure definition PROCEDURE iwelcome( iNum in NUMBER, iOutput out NUMBER, st out sampleType ); PROCEDURE uwelcome; END firstPackage; / create or replace PACKAGE BODY firstPackage is PROCEDURE iwelcome( iNum in NUMBER, iOutput out NUMBER, st out sampleType) IS i NUMBER; refcursor c_mx1_type; BEGIN iOutput := iNum; OPEN refcursor FOR 'select NAME,ID,DESC from TABLE1 where NUMBER = '||iNum||''; i := 0; LOOP FETCH refcursor into st; EXIT WHEN refcursor%NOTFOUND; i := i+1; END LOOP; --DBMS_OUTPUT.PUT_LINE(nvl(st.name,'NVL')); END; END; / And MY Java Programme to Call this Procedure in Package contains the following snippet: CallableStatement cs = (OracleCallableStatement)conn.prepareCall("{call firstPackage.iwelcome(?,?,?) }"); cs.setInt(1,3456); cs.registerOutParameter(1,java.sql.Types.INTEGER); cs.registerOutParameter(2,java.sql.Types.STRUCT,"firstPackage.sampleType"); cs.execute(); I am not able to register the second outputParameter. I have tried giving STRUCT, ARRAY etc. etc and every time I get the java.sql.SQLException: invalid name pattern: firstPackage.sampleType Exception. I am using classes12.jar as the driver. Please help me out. Thanks and Regards, tanmoy

Software/Hardware used:
ASKED: November 6, 2004  10:41 PM
UPDATED: November 9, 2004  8:51 AM

Answer Wiki:
Try define the type globally (not within a package) CREATE TYPE ....
Last Wiki Answer Submitted:  November 9, 2004  8:51 am  by  SergLNC   0 pts.
All Answer Wiki Contributors:  SergLNC   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _