RE: DBA_TABLES problem

RE: DBA_TABLES problem

 

  

You need direct grant dba_tables.
Or else add
AUTHID CURRENT_USER to your procedure..

Example

Create or replace procedure foo
AUTHID CURRENT_USER
As
Begin
Null;

End;
/

All the best,
Regis

-----Original Message-----
From: [Email Address Removed] [mailto:[Email Address Removed]
Sent: 30 January 2004 10:51
To: LazyDBA.com Discussion
Subject: DBA_TABLES problem





Dear all ,

I am making procedure to analyze tables of a user by selecting from
dba_tables. It is working ok when I run code from sql*plus as anonyms
block .

SQL> ed
Wrote file afiedt.buf
1 declare
2 cursor c1 is select table_name from dba_tables where owner='SCOTT';
3 begin
4 for c1rec in c1 loop
5 dbms_output.put_line(c1rec.table_name);
6 end loop;
7* end;
SQL> /
BONUS
CLIENT_MASTER
CUSTOMER
CUSTOMERS
PL/SQL procedure successfully completed.

But when I am making a named procedure ( ie; create procedure abc as
............) from same code , it is giving error "ORA-00942 : TABLE OR
VIEW DOES NOT EXIST " for dba_tables in the cursor .
Is it a oracle bug or anything missing.

regds,

mks


--------
Get today's cartoon: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] using this list you agree to these
terms:http://www.lazydba.com/legal.html
*********************************************************************
This electronic transmission is strictly confidential and intended solely
for the addressee. It may contain information which is covered by legal,
professional or other privilege. If you are not the intended addressee,
you must not disclose, copy or take any action in reliance of this
transmission. If you have received this transmission in error,
please notify the sender as soon as possible.

This footnote also confirms that this message has been swept
for computer viruses.
**********************************************************************

Oracle LazyDBA home page