Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify an Oracle View

Status
Not open for further replies.

TheObserver

Programmer
Mar 26, 2002
91
US
The fact that this question relates to an Oracle database may or may not be of significant value, but I thought it best to throw in here anyway.

I have an existing view in an Oracle database. I need to modify this view due to a change in a table it utilizes (I need to add four columns and remove one).

Is this possible? I'd like to avoid having to dump it and recreate it from scratch (especially since I DO NOT know how it was originally created).

Thanks for your time.
 
A view can be dropped and recreated. To see how a view was created, from SQL*Plus run:
Code:
select text
from   sys.all_source
where  owner = 'MY_SCHEMA'
and    name = 'MY_VIEW'
order by line
[code][/color]
substituting your owner & schema name. Good luck!

[COLOR=teal][code]select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
When posting code, please use TGML to help readability. Thanks!
 
That doesn't seem to work. I tried it your way first with "no rows selected", then tried substituting in the view name for 'text' in your statement (along with a 'Select *...' just to see if that would work).

Thanks for the help. Any other suggestions?
 
Try running:
[/code]
select owner, view_name
from sys.all_views
order by 1,2;
[/code]

to find the owner and view you need.

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
When posting code, please use TGML to help readability. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top