1

这是堆栈中发生错误的位置:

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

说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详细信息:System.Data.OracleClient.OracleException:ORA-06550:第 1 行,第 38 列:PLS-00302:必须声明组件“SPDATA_PARAMS_SEARCH” ORA-06550:第 1 行,第 7 列:PL/SQL:忽略语句

源错误:

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 指向正确的位置和所有内容,所以我不知道这是从哪里来的。

4

2 回答 2

3

首先确保调用该过程的用户对该过程具有执行权限,其次确保调用该过程的用户可以直接使用 schemaname.procedurename 或 synonymname.procedure name 看到该过程,同义词可以是 public 或私人的。

希望能帮助到你

于 2010-06-14T07:55:41.790 回答
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
于 2016-12-01T01:35:39.817 回答