If the Master Table is deleted, then VIEW definition will not be deleted but when you try to access the view, you will get -206 error code stating that the object is not found.
View is not a physical stuff. It is a logical one. A view is an alternative way of representing data that exists in one or more tables.
No records will be stored inside the view. Whenever we access the view, it will in turn read the table based on the View definition and display the data.
Only the definition will be present. Logically speaking VIEW will not be present in other words, we cannot access if the base table is dropped.
View will not be automatically dropped when we drop the table. Yes, we cannot perform any operations using Views without the table existence but View definition will be reside in SYSIBM.SYSVIEWS until it expliciltly dropped.
Joined: 05 Feb 2007 Posts: 158 Location: Sri Lanka
Suresh Ponnusamy wrote:
Hi
View will not be automatically dropped when we drop the table. Yes, we cannot perform any operations using Views without the table existence but View definition will be reside in SYSIBM.SYSVIEWS until it expliciltly dropped.
Actually this is incorrect. As per DB2 V7 in z/OS, views is gone along with table. I am not sure of V8, but probably same in there as well. Perhaps you can point to some IBM manual that confirms your conclusion.