473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Ora-942 in stored procedure

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
Jul 19 '05 #1
6 11943
DA Singh wrote:
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

As always - grant select on table1 to <owner of the procedure>
roles are _not_ active in PL/SQL, they are in SQL.

--
Regards, Frank van Bortel

Jul 19 '05 #2
da*****@hotmail.com (DA Singh) wrote in message news:<78**************************@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 --
Jul 19 '05 #3
Thank you Frank and Mark.
Our DBA didn't know this.
regards,
D A Singh
Jul 19 '05 #4
DA Singh wrote:
Thank you Frank and Mark.
Our DBA didn't know this.
regards,
D A Singh


Your programmer(s) should, as they ought to be able to
explain the DBA what privileges to grant to which user.
--
Regards, Frank van Bortel

Jul 19 '05 #5
Frank <fb*****@home.nl> wrote in message news:<bo**********@news3.tilbu1.nb.home.nl>...
DA Singh wrote:
Thank you Frank and Mark.
Our DBA didn't know this.
regards,
D A Singh


Your programmer(s) should, as they ought to be able to
explain the DBA what privileges to grant to which user.


They did. The end users don't use sqlplus.
Jul 19 '05 #6
sounds like a case of case. Make sure you access your tables between
double-quotes, such as

insert into "table2" select col1, col2 from schema2."table1";

try renaming all your tables to upper case and you'll be able to
access them without the quotes.

it's a shame oracle never came out with a different error-code.

Jeff
da*****@hotmail.com (DA Singh) wrote in message news:<78**************************@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

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Subrahmanyam Arya | last post by:
Dear oracle gurus, I am unable to get past the error ORA-12154: TNS: could not resolve service name on my host when using hsodbc to talk to a remote mysql database. i got from the meta link all...
6
by: John | last post by:
Hi Right password -> ORA-12154: TNS:Could not resolve service name wrong password => ORA-01017: invalid username/password; logon denied Tested on a Windows XP client connecting to Oracle on...
1
by: Park Yeon Jo | last post by:
About Error : ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor I installed Oracle 8.1.7 on Windows XP Professional. and I wanto connect to that server...
1
by: Adam Ruth | last post by:
I'm using OCI on Mac OS X and I've run into a strange problem with my TNSNAMES.ORA file. My TNSNAMES.ORA file has one entry INV4II and it works fine. However, it will only work if that is the...
6
by: bdj | last post by:
Hello! I have at set of tnsnames.ora. I wich to make an union, e.g. a single file of it. How can I do that easy? Greetings Bjørn
4
by: Tig | last post by:
Hi all. I have a need to connect to an Oracle 7.3.3.5 database. I have a user who successfully connects to it with her Oracle 7.3 client. I have an Oracle 9.2 client installed on my machine. ...
2
by: mpatel6 | last post by:
I had this error in alert log and my instance was down, anybody can help me? Errors in file /u01/app/oracle/admin/sotstest/bdump/sotstest_p004_626740.trc: ORA-07445: exception encountered: core...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
0
by: basmgokul | last post by:
I am using oracle 10g in windows vista.. when starting DB it throws an error Errors in file c:\database\udump\practice_ora_440.trc: ORA-00704: bootstrap process failure ORA-39700: database...
1
by: michael ngong | last post by:
michael.john@gmx.at (Michael John) wrote in message news:<90cc4edd.0306230900.28075193@posting.google.com>... MIchael I you stated the OS and platform that could make it easier to address your...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.