Home » SQL & PL/SQL » SQL & PL/SQL » How to rename a column in a view.
How to rename a column in a view. [message #239527] Tue, 22 May 2007 10:37 Go to next message
kori
Messages: 3
Registered: May 2007
Location: US
Junior Member

Hi,

I want to rename a column in a view. Can you pls give me the syntax or an example of how to do this.

Thanks,
Kori
Re: How to rename a column in a view. [message #239533 is a reply to message #239527] Tue, 22 May 2007 10:47 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
re-create the view using create or replace by changing the column alias.

By
Vamsi
Re: How to rename a column in a view. [message #239543 is a reply to message #239533] Tue, 22 May 2007 10:58 Go to previous messageGo to next message
kori
Messages: 3
Registered: May 2007
Location: US
Junior Member

Hi,

Is there any other option other than create or replace.

Can i do something with ALTER VIEW OR RENAME commands.

Thanks.
Re: How to rename a column in a view. [message #239545 is a reply to message #239543] Tue, 22 May 2007 11:01 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
No there is no such a clause for view for renaming column.
however you can take a look here
http://www.ss64.com/ora/view_a.html

[Updated on: Tue, 22 May 2007 11:03]

Report message to a moderator

Re: How to rename a column in a view. [message #239546 is a reply to message #239543] Tue, 22 May 2007 11:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, this is the only option.
But a view is just a text. It is immediate.
Just see "create or replace" as "alter".

Regards
Michel
Re: How to rename a column in a view. [message #239547 is a reply to message #239543] Tue, 22 May 2007 11:02 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
ALTER VIEW serves these purposes only.
another link
By
Vamsi

[Updated on: Tue, 22 May 2007 11:02]

Report message to a moderator

Re: How to rename a column in a view. [message #239593 is a reply to message #239527] Tue, 22 May 2007 13:14 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
A view is simply a stored query. When you use it the query is fired. If you want to change a column name, simply resave the select (as was urged above)
Re: How to rename a column in a view. [message #240283 is a reply to message #239593] Thu, 24 May 2007 09:37 Go to previous message
kori
Messages: 3
Registered: May 2007
Location: US
Junior Member

Thanks a lot for your responses.
Previous Topic: Trigger not working with empty fields
Next Topic: Trace all DML statements in a series of procedures
Goto Forum:
  


Current Time: Thu Dec 08 20:13:31 CST 2016

Total time taken to generate the page: 0.10560 seconds