View previous topic :: View next topic
|
Author |
Message |
kespra Currently Banned New User
Joined: 03 Jun 2008 Posts: 24 Location: bangalore
|
|
|
|
If Master table gets deleted then view also will be deleted or not? |
|
Back to top |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
Hi
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. |
|
Back to top |
|
|
kespra Currently Banned New User
Joined: 03 Jun 2008 Posts: 24 Location: bangalore
|
|
|
|
Thanks for for the answer but one doubt whether View table is present or not |
|
Back to top |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
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.
Please refer the below link
msdn.microsoft.com/en-us/library/aa258841(SQL.80).aspx
Hope this helps. |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
Actually View will be dropped with the table in DB2. There won't be anything left of the view. DB2 and SQL Server don't always follow same rules! |
|
Back to top |
|
|
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 107 Location: New York
|
|
|
|
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. |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 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. |
|
Back to top |
|
|
|