如何在 jdbc 中检索 record%type 的表。当我运行java代码时,我收到ORA-04043:对象“PERSON_TB”不存在。包编译成功:CREATE OR REPLACE PACKAGE MYPKG AS TYPE personrec IS RECORD( id VARCHAR2(10)); type_person_rec personrec; TYPE person_tb IS TABLE OF type_person_rec%TYPE;PROCEDURE callproc(persondata OUT person_tb);END MYPKG;/CREATE OR REPLACE PACKAGE BODY MYPKG ASPROCEDURE callproc(persondata OUT person_tb) ASlv_persondata person_tb;BEGINlv_persondata(1).id := '123';persondata := lv_persondata;lv_persondata.DELETE;END callproc;END MYPKG;下面是获取参数的java代码:String sql = "{call mypkg.callproc(?)}";stmt = conn.prepareCall(sql);stmt.registerOutParameter(1, java.sql.Types.ARRAY,"PERSON_TB");stmt.execute();
添加回答
举报
0/150
提交
取消