Solved

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

Posted on 2011-03-10
6
635 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Assisted Solution

by:Dave Ford
Dave Ford 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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