Re: Ora-942 in stored procedure

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 10 Nov 2003 14:27:11 -0800
Message-ID: <2687bb95.0311101427.3d65e6e_at_posting.google.com>


dasingh_at_hotmail.com (DA Singh) wrote in message news:<78340f33.0311100847.45d99306_at_posting.google.com>...
> Hi,
> I have a stored procedure that tries to select from a table owned by
> another schema -
> create or replace procedure schema1.procedure1
> as
> insert into table2
> select col1, col2
> from schema2.table1;
> end;
> /
>
> And I get the Ora-942 error - Table or view does not exist.
> I can select from the table from the SQL prompt, when logged in as
> schema1.
> Are there some permissions that need to be set?
> The Oracle version is 9.2.0.3.0
> Thanks,
> D A Singh

It is fairly clearly stated in the manuals that for a procedure owned by A to reference objects owned by B that user A must have a direct grant on the object and not inherit his or her privileges through a role.

HTH -- Mark D Powell -- Received on Mon Nov 10 2003 - 23:27:11 CET

Original text of this message