Home » Server Options » Replication » create a Materialized View without having any data in it (merged)
create a Materialized View without having any data in it (merged) [message #357421] Wed, 05 November 2008 05:16 Go to next message
intel_neeraj@hotmail.com
Messages: 1
Registered: November 2008
Junior Member
Can anybody let me know how I can create a Materialized View without having any data in it.

For e.g I create a Materialialized View based on a View.
CREATE MATERIALIZED VIEW test_mv
REFRESH FORCE ON DEMAND
AS
SELECT * FROM test_view

In the above case the data fetched by the view test_view gets stored in the Materialized View test_mv.

Suppose I want materialized view test_mv to get created with all the columns of test_view but not the data.
I will refresh the materialized view test_mv later for data as and when required.

What shall I do for immidiate formation of materialized view test_mv without data.
Re: create a Materialized View without having any data in it [message #357429 is a reply to message #357421] Wed, 05 November 2008 05:31 Go to previous messageGo to next message
babuknb
Messages: 1734
Registered: December 2005
Location: NJ
Senior Member

http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guideline as stated in URL above

>>Can anybody let me know how I can create a Materialized View without having any data in it.

Good Question.

SQL> select * from dual where 1>2;

no rows selected


Try this & let us know.
CREATE MATERIALIZED VIEW test_mv
REFRESH FORCE ON DEMAND
AS 
SELECT * FROM test_view where 1>2;

Babu


[Updated on: Wed, 05 November 2008 05:32]

Report message to a moderator

Re: create a Materialized View without having any data in it [message #357435 is a reply to message #357421] Wed, 05 November 2008 05:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Note that this "Test" forum is NOT for getting answer but for testing your post.
If you really want to post a question then post it in the approprioate forum, in this case "Replication"; I move it there.

Regards
Michel

[Updated on: Wed, 05 November 2008 06:07]

Report message to a moderator

Re: how I can create a Materialized View without having any data in it. [message #357444 is a reply to message #357421] Wed, 05 November 2008 06:13 Go to previous messageGo to next message
bonker
Messages: 402
Registered: July 2005
Senior Member
you can use build deferred option while creating Materialized view. Read documentation about this BUILD clause in MV
Re: how I can create a Materialized View without having any data in it. [message #357448 is a reply to message #357421] Wed, 05 November 2008 06:15 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't multipost your question but post it in the appropriate forum.

Regards
Michel
Previous Topic: illegal use of LONG datatype error message when i create materialized view
Next Topic: Replicate one table in two materialized views at same time
Goto Forum:
  


Current Time: Sat Dec 03 20:03:41 CST 2016

Total time taken to generate the page: 0.14634 seconds