PLS-00302: state that my stored procedure is not declared

This is where the error occurs on the stack:

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; } 

And here is the error text:

 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. View the stack trace for error information and where it originated in the code.

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

Source Error:

 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>(); 

My web.config points to the right place and everything so that I don’t know where it comes from.

+1
c # oracle plsql ora-06550
source share
2 answers

firstly, make sure that the user calling the procedure has the rights to execute this procedure, and secondly, make sure that the user calling the procedure can see the procedure either directly using the name schemaname.procedurename or the name of synonyms. procedures, synonym can be both public and private.

hope this helps

+2
source share

Janbo's answer is this place, give it the top. The following is an example script for deploying a database to make sure this does not happen again:

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 
0
source share

All Articles