2010-05-14 32 views
1

這裏是錯誤的在棧中發生:PLS-00302:告訴我我的存儲過程中沒有說明

public static IKSList<DataParameter> Search(int categoryID, int departmentID, string title) 
     { 
      Database db = new Database(DatabaseConfig.CommonConnString, DatabaseConfig.CommonSchemaOwner, "pkg_data_params_new", "spdata_params_search"); 
      db.AddParameter("category_id", categoryID); 
      db.AddParameter("department_id", departmentID); 
      db.AddParameter("title", title, title.Length); 

      DataView temp = db.Execute_DataView(); 

      IKSList<DataParameter> dps = new IKSList<DataParameter>(); 

      foreach (DataRow dr in temp.Table.Rows) 
      { 
       DataParameter dp = new DataParameter(); 
       dp.Load(dr); 
       dps.Add(dp); 
      } 

      return dps; 
     } 

這裏是錯誤的文字:

ORA-06550: line 1, column 38: 
PLS-00302: component 'SPDATA_PARAMS_SEARCH' must be declared 
ORA-06550: line 1, column 7: 
PL/SQL: Statement ignored 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OracleClient.OracleException: ORA-06550: line 1, column 38: PLS-00302: component 'SPDATA_PARAMS_SEARCH' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored

源錯誤:

Line 161:   db.AddParameter("title", title, title.Length); 
Line 162: 
Line 163:   DataView temp = db.Execute_DataView(); 
Line 164: 
Line 165:   IKSList<DataParameter> dps = new IKSList<DataParameter>(); 

我的web.config指向t他正確的地方和一切,所以我不知道這是從哪裏來的。

+0

你確定你的應用程序被連接作爲具有訪問PROC用戶? – Gabe 2010-05-14 13:57:07

+0

我猜「spdata_params_search」應該是大寫的。 – Polyfun 2010-05-14 16:15:55

回答

2

首先確保調用過程的用戶對過程具有執行權限,其次確保調用過程的用戶可以直接使用schemaname.procedurename或synonymname.procedure名稱查看過程,同義詞can無論是公共還是私人。

希望它有助於

0

通過janbo答案是當場上,給他一個給予好評。下面是一個腳本來把你的數據庫部署,以確保這不會再發生了:

sqlplus @CreateSynonyms.sql

-- CreateSynonyms.sql : Creates synonyms on XYZ_USER for all packages that don't already have synonyms 

spool CreateSynonyms.log 

DECLARE 
    owner  VARCHAR2(20) := 'XYZ'; 
    currentUser VARCHAR2(20); 
    executeLine VARCHAR2(200); 
BEGIN 
    -- Get the user we're currently executing as 
    SELECT sys_context('USERENV', 'SESSION_USER') INTO currentUser FROM dual; 

    FOR x IN (SELECT p.table_name FROM user_tab_privs p 
       WHERE p.owner = owner 
       AND p.privilege = 'EXECUTE' 
       AND p.table_name NOT IN (
        SELECT table_name FROM user_synonyms 
        WHERE table_owner = owner 
       ) 
      ) LOOP 
    executeLine := 'CREATE OR REPLACE SYNONYM ' || x.table_name || ' FOR ' || owner || '.' || x.table_name; 
    DBMS_OUTPUT.PUT_LINE(executeLine); 
    EXECUTE IMMEDIATE executeLine; 
    END LOOP; 
END; 
/ 
spool off 
相關問題