java. sql. Sqlexception: ora-06550: after calling the procedure from Java code

Hi, I have a problem calling stored procedures

connection = ConnectionManager.getInstance().getConnection(dataBaseURL,serverName,portNumber,sid,username,password);

callable = connection.prepareCall("{call SCHEMA_RESTORE.restore()}");

callable.executeUpdate();
..................................

I got the exception

Exception in thread "main" java.sql.sqlException: ORA-06550: line 1,column 7:

PLS-00201: identifier 'SCHEMA_RESTORE.RESTORE' must be declared
ORA-06550: line 1,column 7:
PL/sql: Statement ignored

at oracle.jdbc.dbaccess.DBError.throwsqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)

My prodedure is

CREATE OR REPLACE PACKAGE BODY SCHEMA_RESTORE IS 
  PROCEDURE backup (pbRecreateBackupTable IN BOOLEAN DEFAULT FALSE)
    IS
      TableAlreadyExists EXCEPTION;
      PRAGMA EXCEPTION_INIT (TableAlreadyExists,-955);
      nCount NUMBER;
      CURSOR cTables IS SELECT tbls.table_name tbl,SUBSTR(tbls.table_name,4) name FROM user_tables tbls,FT_T_TBDF tbdf
        WHERE tbls.table_name NOT LIKE gsPrefix || '%' AND tbls.table_name NOT LIKE 'FT_CFG%' AND tbls.table_name NOT IN ('FT_WF_APEV','FT_WF_WFTJ','FT_WF_WFTN','FT_WF_WFNP','FT_WF_WFNV','FT_WF_WFIO','FT_WF_WFGV','FT_WF_WFND','FT_WF_WFDF','EXCEPTIONS','TESTDSFP') and tbls.table_name NOT LIKE 'FT_LOG%'
          AND tbdf.tbl_id(+) = SUBSTR(tbls.table_name,-4) AND tbdf.tbl_desc NOT LIKE '%Note: This table is obsolete%';
BEGIN

        RAISE;
    END;
  END LOOP; 
EXCEPTION
  WHEN OTHERS THEN
    RAISE;
END backup;

Solution

The error message shows that schema cannot be found_ RESTORE. RESTORE. There are several possible reasons:

>Packages (and programs) adopt different modes. For example, you compile them as user a but try to call them user B. > you do not have access to execute procedures from packages So it becomes invisible. > You have defined the procedure in the package body, but you have not declared it in the package header

Another problem I can see is parentheses If you call a program without parameters, these assumptions should be omitted:

{ call SCHEMA_RESTORE.restore }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>