Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: plsql statement for login

Re: plsql statement for login

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Fri, 31 Mar 2006 16:55:46 +0200
Message-ID: <e0jf3p$a6m$1@news6.zwoll1.ov.home.nl>


infested wrote:
> Ok, i can switch schema, but i want to create view on this schema. Is
> it possible to grant creating view on achema?
>

No - grants are issued to users, not schema's. Grants are issued for object usage; an object belongs to a schema, which belongs to a user.

What are you trying to do?
Log on as A, and create view B.a_view as select ... from C.a_table?

Grant create any view to A.
C has to grant select on a_table to B.

switch schema will just change the "create view b.a_view" to "create view a_view".
In both cases B will own the view:

Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production

SQL> show user
USER is "SYSTEM"
SQL> create view scott.a_view as select * from dual; View created.

SQL> select owner, view_name from dba_views where view_name='A_VIEW';

OWNER                          VIEW_NAME
------------------------------ ------------------------------
SCOTT                          A_VIEW

SQL> drop view scott.a_view;
View dropped.

SQL> alter session set current_schema=SCOTT; Session altered.

SQL> create view a_view as select * from dual; View created.

SQL> select owner, view_name from dba_views where view_name='A_VIEW';

OWNER                          VIEW_NAME
------------------------------ ------------------------------
SCOTT                          A_VIEW

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Fri Mar 31 2006 - 08:55:46 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US