|
|
|
|
Re: Does force view option works in oracle 11g? [message #471309 is a reply to message #471308] |
Fri, 13 August 2010 05:08   |
cookiemonster
Messages: 13967 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You're not wrong.
It works on my 11g instance:
SQL*Plus: Release 11.1.0.7.0 - Production on Fri Aug 13 11:06:06 2010
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
SQL> create or replace force view testview
2 as select * from none_existant_table;
Warning: View created with compilation errors.
SQL>
@harinixyz - what exact version of 11g are you using?
It must be an oracle bug though.
|
|
|
Re: Does force view option works in oracle 11g? [message #471310 is a reply to message #471307] |
Fri, 13 August 2010 05:08   |
|
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE 11.2.0.1.0 Production"
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
I am able to create the view, but When I give a Select It would fail
SQL> create or replace force view check123 as select * from checks;
Warning: View created with compilation errors.
SQL> show errors;
No errors.
SQL> select * from check123;
select * from check123
*
ERROR at line 1:
ORA-04063: view "PATOJUV_RMS01.CHECK123" has errors
SQL> select * from v$version;
BANNER
-------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL>
It worked....
|
|
|
Re: Does force view option works in oracle 11g? [message #471314 is a reply to message #471310] |
Fri, 13 August 2010 05:19   |
Its_me_ved
Messages: 979 Registered: October 2009 Location: India
|
Senior Member |
|
|
Though the view was created it was marked as invalid. So you cant access unless the table is created.
You can check the status in USER_OBJECTS.
Also, want to add that to create a view you need to have the sufficient privilege
Oracle documentation says:
Quote:
FORCE
Specify FORCE if you want to create the view regardless of whether the base tables of the view or the referenced object types exist or the owner of the schema containing the view has privileges on them. These conditions must be true before any SELECT, INSERT, UPDATE, or DELETE statements can be issued against the view.
If the view definition contains any constraints, CREATE VIEW ... FORCE will fail if the base table does not exist or the referenced object type does not exist. CREATE VIEW ... FORCE will also fail if the view definition names a constraint that does not exist.
Regards
Ved
[Updated on: Fri, 13 August 2010 05:30] Report message to a moderator
|
|
|
|
Re: Does force view option works in oracle 11g? [message #471329 is a reply to message #471328] |
Fri, 13 August 2010 07:26   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
ashoka_bl wrote on Fri, 13 August 2010 14:23@harinixyz , Could you let us know whether you able to execute the View ?
That's what you get when everyone sends in similar bits of code..
The original post shows very clearly what (s)he tried. (and what does "executing" a view mean?!)
|
|
|
|
Re: Does force view option works in oracle 11g? [message #471429 is a reply to message #471352] |
Sat, 14 August 2010 08:03   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Michel Cadot wrote on Fri, 13 August 2010 17:32Quote:The original post shows very clearly what (s)he tried. (and what does "executing" a view mean?!)
Not entirely, "is there any synonym (private or public) for employee?" is one question I ask myself.
"What is the complete Oracle version?" is another one.
... which has nothing to do with showing what the Original Poster tried. My comment to ashoka_bl's reply still stands.
|
|
|
|