Solved

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

Posted on 2011-03-10
6
618 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
Comment Utility
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
Comment Utility
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
Comment Utility
Yes I know..
I can also use DSPFD(LIB/VIEW) to retreive the sql code..
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

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

Assisted Solution

by:daveslash
daveslash earned 166 total points
Comment Utility

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
Comment Utility
ok thank you everybody..
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

10 Experts available now in Live!

Get 1:1 Help Now