If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Drop View

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-02-08, 09:31
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
Drop View

OS/390

V7.2 - V.8

Just curious...If I drop a view and recreate it....do I have to recompile/bind DB2 External Stored Procedures for it to see the new view?
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #2 (permalink)  
Old 04-02-08, 09:45
SuperKuper SuperKuper is offline
Registered User
 
Join Date: Apr 2008
Posts: 51
I believe in this case packages referencing the dropped object will be invalidated. You do not need to recompile - an explicit rebind will suffice. Not sure if automatic rebind will take care of this.
__________________
db2topgun.com
Reply With Quote
  #3 (permalink)  
Old 04-02-08, 09:49
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
just did it in v8 compatibility mode and it worked without bind/recompile

Have to check QA which is at 7.2...which is what the prod level is at
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #4 (permalink)  
Old 04-02-08, 09:53
SuperKuper SuperKuper is offline
Registered User
 
Join Date: Apr 2008
Posts: 51
Looks like auto-rebind is taking place and resolving the issue for you. You can check if the package is not valid after drop and valid again after first execution attempt (when auto-rebind happens).
__________________
db2topgun.com
Reply With Quote
  #5 (permalink)  
Old 04-02-08, 09:56
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
Quote:
Originally Posted by SuperKuper
Looks like auto-rebind is taking place and resolving the issue for you. You can check if the package is not valid after drop and valid again after first execution attempt (when auto-rebind happens).
And where would I check? The catalog?

Where would I look and what would I look for?

Thanks for your help
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #6 (permalink)  
Old 04-02-08, 11:21
SuperKuper SuperKuper is offline
Registered User
 
Join Date: Apr 2008
Posts: 51
select creator,name from sysibm.sysplan where valid <> 'Y'
__________________
db2topgun.com
Reply With Quote
  #7 (permalink)  
Old 04-02-08, 13:48
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Is your routine (stored proc) using dynamic SQL by any chance? If so, you won't have any issues with packages.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #8 (permalink)  
Old 04-02-08, 19:17
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Automatic rebind of a SP package (or any static SQL in a package) will take care of this.

When a dependent object is dropped that a package needs, the package is marked invalid. The first time that someone executes the program (and the invalid package is invoked) DB2 will automatically do a rebind on the package. If the needed object (in this case the view) is still not present during the rebind while the package is marked as invalid, then the package will be marked as inoperative, and an explicit rebind will be needed (after the view is created).

So if no one tried to execute the program in between the time the view was dropped and then recreated, then the automatic rebind will work.

The same applies to z/OS except that it applies to packages and plans.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #9 (permalink)  
Old 04-04-08, 13:49
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
Thanks for the info
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On