PLS-00302 = the package/schema was found, the name inside it wasn't.
Cause 1: declared only in the package BODY. Add it to the SPEC.
Cause 2: name mismatch: typo, or created with double quotes (case-sensitive).
Cause 3: name collision: a schema or local object with the same name as the package.
Check: SELECT procedure_name FROM all_procedures WHERE object_name = 'PKG';
✦ Definition~90s read
What is PLS-00302?
PLS-00302 is a PL/SQL compile error. Oracle resolves a dotted name such as pkg.func left to right; it found the first part but not the component after the dot. It usually arrives with ORA-06550, which gives the line and column.
★
You asked reception for 'Finance, Priya'.
Plain-English First
You asked reception for 'Finance, Priya'. Reception found Finance, but there's no Priya on the public directory: she's either not listed, spelled differently, or you reached the wrong Finance.
The function is in the code, yet every call fails with PLS-00302. Oracle doesn't see the code you see: it sees the package specification, under the name and schema it resolves.
How Oracle Resolves the Name
Oracle resolves a.b left to right: it finds a (a schema, package or variable in scope), then looks for b inside it. PLS-00302 means b wasn't found inside the a it chose.
call.sqlSQL
1
2
3
BEGIN
v := agr_pkg.nbr_cgms_agrmnt(101);
END;
Output
ORA-06550: line 2, column 15:
PLS-00302: component 'NBR_CGMS_AGRMNT' must be declared
🎯 Key Takeaway
First part found, second not.
Cause 1: Not in the Spec
Only items declared in the package specification are visible outside the package.
spec.sqlSQL
1
2
3
4
CREATEORREPLACEPACKAGE agr_pkg ASFUNCTIONnbr_cgms_agrmnt(p_id NUMBER) RETURNNUMBER;
END agr_pkg;
/
🎯 Key Takeaway
Declare it in the spec.
Cause 2: Name Mismatch
A typo, or an identifier created in double quotes, which makes it case-sensitive and must then always be quoted.
names.sqlSQL
1
2
3
SELECT object_name, procedure_name
FROM all_procedures
WHERE object_name = 'AGR_PKG';
🎯 Key Takeaway
Match the exact name.
Cause 3: Name Collision
If a schema or local object has the same name as the package, Oracle may resolve to it and then fail to find the component. Qualify with the owner.
qualified.sqlSQL
1
v := fin_owner.agr_pkg.nbr_cgms_agrmnt(101);
🎯 Key Takeaway
owner.pkg.name.
● Production incidentPOST-MORTEMseverity: high
The Function That Was Only in the Body
Symptom
ORA-06550: line 42, column 30: PLS-00302: component 'NBR_CGMS_AGRMNT' must be declared.
Assumption
If the package body compiles, the function is callable.
Root cause
The function was declared only in the package body, making it private. The spec didn't list it.
Fix
Added the function declaration to the package spec and recompiled spec and body.
Key lesson
Callers see only the spec.
Check all_procedures for the package.
Compile spec and body together.
Production debug guideFind which cause2 entries
Symptom · 01
Name not in all_procedures
→
Fix
Not in the spec, misspelled, or in another schema.
Symptom · 02
Works when fully qualified
→
Fix
Name collision: a schema or object with the package's name.
⚙ Quick Reference
4 commands from this guide
File
Command / Code
Purpose
call.sql
BEGIN
How Oracle Resolves the Name
spec.sql
CREATE OR REPLACE PACKAGE agr_pkg AS
Cause 1
names.sql
SELECT object_name, procedure_name
Cause 2
qualified.sql
v := fin_owner.agr_pkg.nbr_cgms_agrmnt(101);
Cause 3
Key takeaways
1
Callers only see the spec.
2
Check all_procedures.
3
Watch quoted identifiers.
4
Qualify with the owner on collisions.
Common mistakes to avoid
2 patterns
×
Body-only declaration
Symptom
PLS-00302 from callers.
Fix
Add to the spec.
×
Quoted identifiers
Symptom
Works only with exact case in quotes.
Fix
Avoid quoted names.
INTERVIEW PREP · PRACTICE MODE
Interview Questions on This Topic
Q01SENIOR
What does PLS-00302 mean?
Q01 of 01SENIOR
What does PLS-00302 mean?
ANSWER
Oracle found the package or schema but not the named component; usually it's not in the package spec.
01
What does PLS-00302 mean?
SENIOR
FAQ · 2 QUESTIONS
Frequently Asked Questions
01
How do I fix PLS-00302 component must be declared?
Make sure the component is declared in the package spec, spelled exactly, and resolved in the right schema.
Was this helpful?
02
Why does ORA-06550 come with PLS-00302?
ORA-06550 reports the line and column of the PL/SQL compile error; PLS-00302 is the actual error.