Solved

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

Posted on 2011-03-10
6
637 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 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