Solved

db2 sql: Is possible change view that is called from another view, without delete the second one?

Posted on 2011-03-10
6
620 Views
Last Modified: 2012-06-21
DB2 sql:
Is it possible change a viewA that is called from another viewB, without delete the second one?
At the moment I have a viewA,
then a viewB that uses viewA.
I want to change viewA without drop it, because if I drop it,  viewB has be dropped too.
And I would like only modify viewA,
something like CHGPF command, in DDS structure...
0
Comment
Question by:bobdylan75
6 Comments
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 167 total points
ID: 35094449
You need to drop the dependent objects, drop the view, re-create the altered view, and recreate any dependent objects.

So you know that you can retrieve the SQL ddl for the views involved using Navigator?   As a result recreating a dependent view only takes a few seconds, since you can retrieve the ddl to a file, drop the view, and then just re-run the saved SQL ddl. To restore the view.

0
 
LVL 37

Assisted Solution

by:momi_sabag
momi_sabag earned 167 total points
ID: 35094452
you can try to use the alter statement but i'm not sure it will work

try to alter viewa, and then re-generate viewb
0
 

Author Comment

by:bobdylan75
ID: 35094970
Yes I know..
I can also use DSPFD(LIB/VIEW) to retreive the sql code..
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:bobdylan75
ID: 35094976
So,
isn't there a different way?
0
 
LVL 18

Assisted Solution

by:daveslash
daveslash earned 166 total points
ID: 35096910

Hi bob,

I don't believe there is any other way. To my knowledge, "DB2 for i" does not have an ALTER VIEW statement. I even checked the documentation for V7R1, and it doesn't seem to exist there, either.

You'll have to retrieve the source of the view and recreate them manually.

HTH,
DaveSlash
0
 

Author Comment

by:bobdylan75
ID: 35096961
ok thank you everybody..
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now