Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> With statement alias problem/10g
All, some Friday afternoon frustration. I have created a script to
demonstrate a problem I am currently having and have included it inline
below. Despite the clear error message "ORA-00942: table or view does
not exist ", I don't understand why it is occurring. Account.orgs is a
table. I cannot find anything on metalink, or perhaps I'm not
searching on the correct term. Full SQLPlus trace included below.
Regards
Mike
TESSELLA Michael.OShea_at_tessella.com
__/__/__/ Tessella Support Services plc
__/__/__/ 3 Vineyard Chambers, ABINGDON, OX14 3PX, England
__/__/__/ Tel: (44)(0)1235-555511 Fax: (44)(0)1235-553301
www.tessella.com Registered in England No. 1466429
SQL> SQL> SQL> CONN user1/user1
SQL> SQL> SQL> CREATE OR REPLACE VIEW testView1 AS2 WITH
5 SELECT COUNT(*) X 6 FROM account.orgs
View created.
SQL> SQL> SQL> CREATE OR REPLACE VIEW testView2 AS2 WITH
4 ( 5 SELECT 1 X 6 FROM DUAL
View created.
SQL> SQL> SQL> GRANT SELECT ON testView1 TO user2;
Grant succeeded.
SQL> GRANT SELECT ON testView2 TO user2;
Grant succeeded.
SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> CONN user2/user2
Name Null? Type ----------------------------------------- -------- ---------------------------- X NUMBER SQL> DESCRIBE user1.testView2 Name Null? Type ----------------------------------------- -------- ---------------------------- X NUMBER
SQL>
SQL> SELECT *
2 FROM user1.testView1;
FROM user1.testView1
*
ERROR at line 2:
ORA-00942: table or view does not exist
SQL>
SQL> SELECT *
2 FROM user1.testView2;
X
1
SQL> SQL> SQL> SQL> SQL> SQL> SQL> SQL> CONN user1/user1
View created.
SQL>
SQL> GRANT SELECT ON testView1 TO user2;
Grant succeeded.
SQL> SQL> SQL> SQL> SQL> SQL> SQL> CONN user2/user2
Name Null? Type ----------------------------------------- -------- ---------------------------- X NUMBER
SQL>
SQL> SELECT *
2 FROM user1.testView1;
X
5745
SQL> SQL> SQL> SQL> SQL> SELECT *
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 -64bi
PL/SQL Release 10.1.0.3.0 - Production
CORE 10.1.0.3.0 Production
TNS for Solaris: Version 10.1.0.3.0 - Production
NLSRTL Version 10.1.0.3.0 - Production
SQL> SQL> SQL> spool offReceived on Fri Aug 12 2005 - 06:21:41 CDT
![]() |
![]() |