简体   繁体   English

尝试从Java代码调用存储的Oracle过程时,我得到ORA-06550

[英]I'm getting ORA-06550 when trying to call a stored Oracle procedure from Java code

Error Description: 错误描述:

 SEVERE: ORA-06550: line 1, column 7: PLS-00103: Encountered the symbol "=" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "<an identifier>" was substituted for "=" to continue. 

Java Code: Java代码:

private String get_Supply_sector_emailid(int poNum) {
    String retString = null;

    try {

        ConnectionManager cm = ConnectionManager.getInstance();
        connection = cm.getConnection();

        // Are there any email ids registered in the contacts for the selected vendor
        String sql = "{ call := PS_DISA_POTXMN. get_supply_sector_emailId(?,?) }";
        poCallableStatement = connection.prepareCall(sql);
        // register the type of the out parameter - an Oracle specific type
        poCallableStatement.setInt(1, poNum);
        poCallableStatement.registerOutParameter(2, Types.VARCHAR);

        // execute and retrieve the result set
        poCallableStatement.execute();
        retString = poCallableStatement.getString(2);
    }
    catch (Exception ex) {
        JDBCHelper.rollback(connection);
        log.error(ex.getMessage(), ex);
        throw new SystemException(ex.getMessage(), ex);
    }

    return retString;
}

Oracle Procedure: Oracle程序:

procedure get_supply_sector_emailId(p_PONUMBER IN number, p_emailId  OUT varchar2) is
begin

select tparcomm 
    into   p_emailId
      from   tra_parpostes, LIENSECAPPRO, SECAPPRO, CDEENTCDE
      where  tpartabl = 9612
      and    ecdcincde = p_PONUMBER
      and    tparpost = SAPCEXAP
      and    liacfin = ecdcfin
       AND    liaccin = ecdccin
      AND    liacinap = sapcinap
      AND    LIASITE=ECDSITE
      and    langue = 'US' 
      AND     tparcmag = 0
      and    tparcomm is not null;

exception
    when others then
    dbms_output.put_line('Excep:' || sqlerrm);
end;

Since I'm a novice in Interfacing with ORACLE db from Java any help is appreciated. 由于我是从Java接口ORACLE db的新手,所以我们非常感谢您的帮助。

Are you sure the "=" is needed? 你确定需要“=”吗? We don't use it when we call procedures in our IBatis SQL Maps: 当我们在IBatis SQL Maps中调用过程时,我们不使用它:

{ call PKG_GOYA_WEB.GOYAPES_ULTIMA_FECHA_LOGUEO(?,?,?) }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.sql.SQLException: ORA-06550: 从 java 代码调用过程后 - java.sql.SQLException: ORA-06550: after calling procedure from java code 在Oracle上调用存储过程会引发ORA-06550异常 - Calling stored procedures on Oracle throws ORA-06550 exception 调用SQL过程:SQL异常 - 代码:6550 ORA-06550 - Calling SQL Procedure: SQL exception - code: 6550 ORA-06550 永久性 ORA-06550 错误,使用 jdbc 从 java 应用程序调用存储的 function - Permanent ORA-06550 error, calling stored function from java application using jdbc java.sql.SQLException:ORA-06550 - java.sql.SQLException: ORA-06550 JDBC-从JAVA调用PLSQL会给出Java.sql.SQLException:ORA-06550 - JDBC - Calling PLSQL from JAVA gives Java.sql.SQLException: ORA-06550 Java语言-java.sql.SQLException:ORA-06550 - Java Language - java.sql.SQLException: ORA-06550 从Java调用Oracle存储过程 - Call Oracle Stored Procedure from Java 引起:java.sql.SQLException:ORA-06550:第 1 行,第 7 列:PLS-00306:ZDBC11CAA5BDA99F77E6FB4DABD_SPE_FA 7 调用中的 ZDBC11CAA5BDA99F77E6FB4DABD8SPE_7 的错误编号或类型 - Caused by: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PR_SP_FAHMI' ORA-06550:第1行,第7列:PLS-00306:错误的数量或调用中的参数类型 - ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM