Error 302: Component must be declared [message #418752] |
Tue, 18 August 2009 08:30 |
waqasbhai
Messages: 118 Registered: August 2008 Location: Pakistan
|
Senior Member |
|
|
Hi
I am getting Error 302: Component "..." must be declared error whenever i qualify a schema name with table, functions, procedure etc. eg if i declare a variable as:
v_temp SCHEMA_NAME.TABLE_NAME.FIELD_NAME%TYPE;
and compile it i get
Error 302: Component "..." must be declared error
however if i remove the scehma name and do it as:
v_temp TABLE_NAME.FIELD_NAME%TYPE;
then it complies fine.
Please note that this problem is occuring in only one user/schema.
Any help
|
|
|
|
|
|
|
|
Re: Error 302: Component must be declared [message #418775 is a reply to message #418752] |
Tue, 18 August 2009 09:20 |
waqasbhai
Messages: 118 Registered: August 2008 Location: Pakistan
|
Senior Member |
|
|
FUNCTION MGR_OTT_APT_APPROVE (pWEEKENDING DATE, pRCODE VARCHAR2, FLAG VARCHAR2) RETURN VARCHAR2 IS
vUUID EMPIRE.MGMT_USRRCREF.UUID%TYPE;
i am getting the error on above declartion
but if i declare it as:
vUUID MGMT_USRRCREF.UUID%TYPE;
then it works fine
|
|
|
|
Re: Error 302: Component must be declared [message #418787 is a reply to message #418752] |
Tue, 18 August 2009 09:42 |
waqasbhai
Messages: 118 Registered: August 2008 Location: Pakistan
|
Senior Member |
|
|
Quote: |
1) do you have a schema called EMPIRE?
|
yes
Quote: |
2) does the user you're trying to compile the function as have permissions to see empires objects?
|
the function is in Empire (function and the table are in the same user)
|
|
|
|
|
|
|
|
|
|
Re: Error 302: Component must be declared [message #418821 is a reply to message #418752] |
Tue, 18 August 2009 11:21 |
waqasbhai
Messages: 118 Registered: August 2008 Location: Pakistan
|
Senior Member |
|
|
Quote: |
But why don't you post it?
|
what should i post?
I already told you that i m getting this error where ever i qualify the schema with any object (table, procedure, function...) and the error is only occuring in this particular user.
And by the way i've already read the guide.
|
|
|
Re: Error 302: Component must be declared [message #418822 is a reply to message #418821] |
Tue, 18 August 2009 11:32 |
cookiemonster
Messages: 13958 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
waqasbhai wrote on Tue, 18 August 2009 17:21 | Quote: |
But why don't you post it?
|
what should i post?
I already told you that i m getting this error where ever i qualify the schema with any object (table, procedure, function...) and the error is only occuring in this particular user.
And by the way i've already read the guide.
|
A complete copy and paste of the procedure creation and the output from show errors. That way we could see exactly which component it's complaining about. I'm guessing it's the table name but haven't actually stated that.
I still think you've got an object called EMPIRE, becuase I can't think of any other explaination for this error.
e.g.:
Connected to:
Oracle Database 10g Release 10.2.0.2.0 - 64bit Production
SQL> sho user
USER is "LIVE"
SQL> create table test (a number);
Table created.
SQL> create table live (b number);
Table created.
SQL> create or replace procedure testproc as
2
3 l live.test.a%TYPE;
4
5 begin
6
7 null;
8
9 end;
10 /
Warning: Procedure created with compilation errors.
SQL> sho errors procedure testproc
Errors for PROCEDURE TESTPROC:
LINE/COL ERROR
-------- -----------------------------------------------------------------
3/3 PL/SQL: Item ignored
3/8 PLS-00302: component 'TEST' must be declared
SQL>
SQL> drop table live;
Table dropped.
SQL> alter procedure testproc compile;
Procedure altered.
SQL> sho errors procedure testproc
No errors.
SQL>
Run the following to be sure:
SELECT * from all_objects where object_name = 'EMPIRE';
|
|
|
|
|
|
|
|
|