Re: views of binary operations

From: Marshall <marshall.spight_at_gmail.com>
Date: 17 Jul 2006 22:06:52 -0700
Message-ID: <1153199212.349745.177450_at_s13g2000cwa.googlegroups.com>


David Cressey wrote:
>
> Consider the following:
>
> CREATE VIEW US_ADDRESSES AS SELECT * FROM ADDRESSES WHERE COUNTRY_CODE =
> 'US';
>
> ALTER TABLE ADDRESSES ADD COLUMN EMAIL_ADDRESS CHAR(25);
>
> Now, the next reference to US_ADDRESSES is going to deliver the new column,
> if the expansion of the wildcard is deferred. If, however, the expansion of
> the wildcard is carried out at definition time, the addition of the new
> column won't be reflected in the view. Come to think of it, I forget which
> way Rdb worked in this regard.

Interesting!

Wildcard attribute specification is something of a problem for modularity,
isn't it? If you fail to explicitly specify the attributes you want, and another
attribute is added that otherwise would not affect your query, you will suddenly be getting one more column than you expected, which might break your code, even if you didn't need to care about the new attribute otherwise.

I didn't say that very well, did I?

Marshall Received on Tue Jul 18 2006 - 07:06:52 CEST

Original text of this message