IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Delete status of DB2 Views


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kespra
Currently Banned

New User


Joined: 03 Jun 2008
Posts: 24
Location: bangalore

PostPosted: Fri Aug 15, 2008 9:03 pm
Reply with quote

If Master table gets deleted then view also will be deleted or not?
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Fri Aug 15, 2008 9:29 pm
Reply with quote

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
View user's profile Send private message
kespra
Currently Banned

New User


Joined: 03 Jun 2008
Posts: 24
Location: bangalore

PostPosted: Fri Aug 15, 2008 10:37 pm
Reply with quote

Thanks for for the answer but one doubt whether View table is present or not
Back to top
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Fri Aug 15, 2008 11:28 pm
Reply with quote

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
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Sat Aug 16, 2008 6:03 am
Reply with quote

Suresh Ponnusamy wrote:

Please refer the below link

msdn.microsoft.com/en-us/library/aa258841(SQL.80).aspx



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
View user's profile Send private message
Suresh Ponnusamy

Active User


Joined: 22 Feb 2008
Posts: 107
Location: New York

PostPosted: Tue Aug 19, 2008 7:53 pm
Reply with quote

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
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Thu Aug 21, 2008 1:22 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Job completes in JES, but the status ... IBM Tools 1
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts DB2 Views with Multiple SQL & Col... DB2 8
Search our Forums:

Back to Top