Re: Table and its view

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 6 Jan 1995 00:55:41 GMT
Message-ID: <3ei4ed$oi3_at_dcsun4.us.oracle.com>


quater_view is probably defined with a where clause, so that not all of the rows in quater are selected. You can view the source for quarter_view (which will tell you the defining query) by selecting from user_views:

select text from user_views where view_name = 'QUARTER_VIEW';

In article <D1vEy3.7I4_at_mail.auburn.edu>, moorthy_at_eng.auburn.edu (Moorthy N. Rekapalli) writes:
|> Hello Everyone,
|> I have a table named "quarter". I also have another table named "quarter_view". When I describe them,
|>
|> SQL> desc quarter;
|> SQL> desc quarter_view;
|>
|> both of them are showing the same attributes (I mean columns). These two tables were created by my predecessor and I am doing that job now. Initially, I thought quarter is the table and quarter_view is view of quarter. But, they are not showing the sam|> e number of records. But, when I add a record into quarter_view, the count is automatically increasing in quarter also. Please see the following for an example.
|>
|> Initially, I did this.
|>
|> SQL> select count(*) from quarter_view;
|>
|> COUNT(*)
|> ----------
|> 2835
|>
|> SQL> select count(*) from quarter;
|>
|> COUNT(*)
|> ----------
|> 3972
|>
|> After adding a record in quarter_view, both rows in quarter_view and quarter are increased by one as shown below:
|>
|> SQL> select count(*) from quarter_view;
|>
|> COUNT(*)
|> ----------
|> 2836 -- initially it was 2835
|>
|> SQL> select count(*) from quarter;
|>
|> COUNT(*)
|> ----------
|> 3973 -- initially it was 3972
|>
|> 1) If quarter_view is a view of quarter, then it should show the same number of rows always.
|>
|> 2) If quarter_view is NOT a view of the quarter, it should not increase the count in quarter automatically.
|>
|> Please let me know what could be the problem.
|>
|> THANKS IN ADVANCE.
|>
|> Moorthy
|> (moorthy_at_eng.auburn.edu)
|>
|> ---
|> :=) Do unto others as you would wish to be done by others. :=)
|>
Received on Fri Jan 06 1995 - 01:55:41 CET

Original text of this message