Home » SQL & PL/SQL » SQL & PL/SQL » Alter View........
Alter View........ [message #253135] Sun, 22 July 2007 21:36 Go to next message
naveenkumar001
Messages: 62
Registered: July 2007
Location: Bangalore
Member

Hi,
Can any one please help me in this matter.

I have created a table :-

create table Employee
(
id number,
name varchar2(10),
city varchar2(10)
);


After that i created view for Employee table :-

create view viewEmployee
as
select * from Employee where id=101;


After that i tried to drop column(city) of table(Employee) through view(viewEmployee).

alter view viewEmployee drop column city
*
ERROR at line 1:
ORA-00905: missing keyword

But in net I saw that a view cannot be altered if we want to alter view means we need to drop the existing view and create view according to our requirements.

But when i was studying Data Dictionary i came across that if we make any changes to view it will affect base tables, then according to that definition in Data Dictionary I should be able to drop column(city) of table(Employee) through view(viewEmployee).


******** Anyone please help me to drop column(city) of table Employee through
view(viewEmployee)**********.


Regards,
Naveen
Re: Alter View........ [message #253141 is a reply to message #253135] Sun, 22 July 2007 23:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You first have to read and follow How to format your posts and How to get a quick answer to your question: TIPS AND TRICKS
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Always post your Oracle version (4 decimals) as most answers depend on version.

Next you can't do that, just have a look at ALTER VIEW in SQL Reference.
You have to recreate the view.

Regards
Michel
Re: Alter View........ [message #253207 is a reply to message #253135] Mon, 23 July 2007 02:35 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I saw you posted this question in another forum and gave a feedback there, it would be nice if you do the same here too.

Regards
Michel
Previous Topic: delete
Next Topic: Declare Variable
Goto Forum:
  


Current Time: Thu Dec 08 02:30:56 CST 2016

Total time taken to generate the page: 0.13985 seconds