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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Select won't work for view create

RE: Select won't work for view create

From: Dasko, Dan <Dan.Dasko_at_cdicorp.com>
Date: Thu, 05 Apr 2001 10:54:56 -0700
Message-ID: <F001.002E2F5E.20010405104617@fatcity.com>

That
was the problem.  Thanks.
<SPAN
class=247394417-05042001> 
<SPAN
class=247394417-05042001>Dan

  <FONT face=Tahoma
  size=2>-----Original Message-----From: Jacques Kilchoer   [mailto:Jacques.Kilchoer_at_quest.com]Sent: Thursday, April 05, 2001   2:31 PMTo: Multiple recipients of list ORACLE-LSubject:   RE: Select won't work for view create
  >-----Original Message----- <FONT
  size=2>>From: Dasko, Dan [<A
  href="mailto:Dan.Dasko_at_cdicorp.com">mailto:Dan.Dasko_at_cdicorp.com]
> >I have a select that works

  fine.  However, it doesn't > work fine when I   try to create a view of the result set. > There is   nothing particularly fancy about the query, just >a   plethora of outer joins from the main table to the secondary tables.
> I get an error back about one of the tables not
  existing, but like I >said, it works as a select,   just not as a create view as ... > <FONT   size=2>>FWIW Oracle 8.0.6 on DG-UX
  To create a view, access to the table has to be granted   directly, not via a role. Have you checked for that?   If you have access via a role, you would be able to   select, but not create view. See example below.   

  SQL> -- CREATING USER X SQL>
  create user x identified by x default tablespace users temporary   tablespace temp ; User
  created. SQL> grant create session, create table to   x ; Grant succeeded. SQL>
  alter user x quota unlimited on users ; User   altered.
  SQL> -- CREATING USER Y SQL>
  create user y identified by y default tablespace users temporary   tablespace temp ; User
  created. SQL> grant create session, create view to   y ; Grant succeeded. SQL>
  create role fory ; Role created. <FONT   size=2>SQL> grant fory to y; Grant
  succeeded.
  SQL> -- X CREATES TABLES SQL> --
  Y WILL HAVE ACCESS TO T1 DIRECTLY SQL> -- Y WILL   HAVE ACCESS TO T2 VIA ROLE SQL> connect x/x@   Connected. SQL> create table t1 (n
  number, d date) ; Table created. <FONT   size=2>SQL> create table t2 (n number, v varchar2 (30)) ; <FONT   size=2>Table created. SQL> grant select on t1 to y   ; Grant succeeded. SQL>
  grant select on t2 to fory ; Grant succeeded.   

  SQL> -- Y CREATES VIEWS SQL> --
  Y IS ABLE TO CREATE A VIEW ON T1 BUT NOT ON T2 SQL>

Received on Thu Apr 05 2001 - 12:54:56 CDT

Original text of this message

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