oracle ORA-06550:第 1 行,第 7 列:PLS-00201:必须声明标识符“PAYMENT_UPDATE” ORA-06550:第 1 行,第 7 列:PL/SQL:忽略语句

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43199043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:24:55  来源:igfitidea点击:

ORA-06550: line 1, column 7: PLS-00201: identifier 'PAYMENT_UPDATE' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored

oraclestored-proceduresjdbcruntime-error

提问by user100000001

I have a procedure to insert values into one table and update rows of another table. The procedure compiled without any errors. If I manually call it within PL/SQL codes, the tables are updated.

我有一个将值插入一个表并更新另一个表的行的过程。程序编译没有任何错误。如果我在 PL/SQL 代码中手动调用它,表就会更新。

CREATE OR REPLACE PROCEDURE payment_update
      (bId IN number, pType IN varchar2, pAmt IN number )
AS
BEGIN
    INSERT INTO payment 
     VALUES (PID_SEQ.NEXTVAL,
              bId, 
              pType, 
              (SELECT CURRENT_DATE FROM DUAL),
              pAmt);
    UPDATE booking 
        SET payment_status = 'FP', 
          paid = pAmt
    WHERE booking_id = bId;
END;
/

I am trying to call this stored procedure in a Java class, through the click of a button. The user enters values into a text field of the GUI frame, those values need to be sent to the stored procedure.

我试图通过单击按钮在 Java 类中调用此存储过程。用户在 GUI 框架的文本字段中输入值,这些值需要发送到存储过程。

This is my Java code -

这是我的 Java 代码 -

private void payButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
    int i = unpaidJTable.getSelectedRow();
    int bookingId =Integer.parseInt(bIdText.getText());
    String pType = pTypeText.getText();
    double pAmt = Double.parseDouble(pAmtText.getText());
    CallableStatement callableStatement = null;
    String paymentUpdateRecord = "{call payment_update(?, ?, ?)}";
    try{
       callableStatement = conn.prepareCall(paymentUpdateRecord);
       callableStatement.setInt(1, bookingId);
       callableStatement.setString(2, pType);
       callableStatement.setDouble(3, pAmt);
       callableStatement.executeUpdate();
       conn.commit();
       System.out.println("Successfully updated!");
   }
    catch(SQLException e){
       System.out.println(e.getMessage());
   }

On clicking this button, I get an error pasted above as the question. Can someone please help me out? I can't figure out what I need to declare.

单击此按钮时,我收到一个错误粘贴在上面作为问题。有人可以帮我吗?我不知道我需要申报什么。

采纳答案by Ashvini

I faced same problem and figured out the solution. Actually, When I searched for answer, other post mentioned that 'there could be permission issue'. Which is quit the case here. As a workaround or solution need to do following: -Drop you SP. -Recreate SP with Parameter (i.e. your final SP)

我遇到了同样的问题并找到了解决方案。实际上,当我搜索答案时,其他帖子提到“可能存在许可问题”。这是退出这里的情况。作为解决方法或解决方案,需要执行以下操作: - 删除 SP。- 使用参数重新创建 SP(即您的最终 SP)

You might have created SP first and later did some changes in Parameter section. See if this helps. However, it did in my case.

您可能先创建了 SP,然后在参数部分进行了一些更改。看看这是否有帮助。但是,在我的情况下确实如此。

回答by Atal

PLS-00201: identifier 'PROC_NAME' must be declared ORA-06550: line 1, column 7:

PLS-00201:标识符“PROC_NAME”必须声明 ORA-06550:第 1 行,第 7 列:

I was able to resolve the issue by creating synonym for the procedure.

我能够通过为程序创建同义词来解决这个问题。