在 Java中 写了 调用 过程的 代码,运行的时候,一直报 PLS-00306 的错误,问题整了我2天了。过程如下,是写在包中的:
create or replace package body PKG_body IS
  procedure P_prc(V_Resultcode Out Number,
                              V_Resultinfo Out Varchar2) is
  end;
end PKG_body;
过程 P_prc 在 PL/SQL中运行 是没有问题的,也只有,两个out参数。{call PKG_body.P_prc (??)}在Java中调用的时候,我也注册了:
stmt.registerOutParameter(1, 2);
stmt.registerOutParameter(2, 12);我也保证,注册的时候,类型是正确的。运行的时候,每次执行到 stmt.execute(); 的时候 就出: PLS-00306  的错误。该问题,拖了我两天,快崩溃了。大家给个思路,相信大家以前也遇到过,把你当时的解决方法提供一下,谢了

解决方案 »

  1.   

    {call PKG_body.P_prc (?,?)}先写个简单的(无参数)试试,确认一下程序没问题
      

  2.   

    PLS-00360: cursor declaration without body needs return type 
    Cause: A cursor declaration lacks either a body (SELECT statement) or a return type. If you want to separate a cursor specification from its body, a return type must be supplied, as in CURSOR c1 RETURN emp%ROWTYPE;
    Action: Add a SELECT statement or return type to the cursor declaration.说是游标的返回类型不正确。你用的CallableStatement还是Statement?把java代码贴上来。
      

  3.   

    程序中,需要切换数据库
    数据切换错了

    是程序问题。。
    TKS啦。