Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Privileges of DBMS_SQL in a stored procedure
--------------FFD6F4BBEDB59346842F4C1C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit
Hi Michael!
Let me quess: You'r calling your procedure, while you're connected with
another schema-sure, 'cause
you'll copy the view !!!
Make sure while using dynamic sql that
1) the user which is calling your procedure has the system privileges to
create a view
2) the user which is calling your procedure has received the object
privileges to access to the base tables/views of the view,
you wish to create!
Even if the proc-caller will temporarely receive the same rights as the proc-owner !!! The proc-caller is executing dynamic sql and so, his own system- and object-priviliges will be checked !!!!!
Scincerly yours
T.Hitzfeld
Oracle DBA
Michael Cretan wrote:
> Hi, > > I have created a procedure that creates views in a schema. It does > this > by extracting the view definitions from tables into a varchar2 field, > and then calls the dbms_sql package to create the view. > > Whilst the PL/SQL works quite happily when executed at the sql prompt, > > when I store it in the database as a procedure and execute it, I get > insufficient privilege errors being raised by the DBMS_SQL package. > > This strikes me as a little strange as the procedure is stored in the > same schema as the views, and their underlying base tables. DBMS_SQL > is > supposed to inherit the privileges of the schema where the procedure > is > stored. > > Has anyone had this problem, and maybe found a workaround for it ? > > We are running Oracle v7.3.2.3.0 on and AIX box. > > Thanks, > > Mike Cretan --------------FFD6F4BBEDB59346842F4C1C
<HTML>
Hi Michael!
<BR>Let me quess: You'r calling your procedure, while you're connected
with another schema-sure, 'cause
<BR>you'll copy the view !!!
<P>Make sure while using dynamic sql that
<BR>1) the user which is calling your procedure has the system privileges
to create a view
<BR>2) the user which is calling your procedure has received the object
privileges to access to the base tables/views of the view,
<BR> you wish to create!
<P>Even if the proc-caller will temporarely receive the same rights as
the proc-owner !!! The proc-caller is executing dynamic sql and so, his
own system- and object-priviliges will be checked !!!!!
<P><B><FONT SIZE=+2>Scincerly yours</FONT></B>
<BR><B><FONT SIZE=+2>T.Hitzfeld</FONT></B>
<BR>Oracle DBA
<P>Michael Cretan wrote:
<BLOCKQUOTE TYPE=CITE>Hi,
<P>I have created a procedure that creates views in a schema. It
does this
<BR>by extracting the view definitions from tables into a varchar2 field,
<BR>and then calls the dbms_sql package to create the view.
<P>Whilst the PL/SQL works quite happily when executed at the sql prompt,
<BR>when I store it in the database as a procedure and execute it, I get
<BR>insufficient privilege errors being raised by the DBMS_SQL package.
<P>This strikes me as a little strange as the procedure is stored in the
<BR>same schema as the views, and their underlying base tables. DBMS_SQL
is
<BR>supposed to inherit the privileges of the schema where the procedure
is
<BR>stored.
<P>Has anyone had this problem, and maybe found a workaround for it ?
<P>We are running Oracle v7.3.2.3.0 on and AIX box.
<P>Thanks,
<P>Mike Cretan</BLOCKQUOTE>
</HTML>
--------------FFD6F4BBEDB59346842F4C1C-- Received on Sat Oct 04 1997 - 00:00:00 CDT
![]() |
![]() |