Solved

how can i update a view in oracle?

Posted on 2011-09-14
7
370 Views
Last Modified: 2013-12-24
i want to change the url in the view, how can i update a column in the view.


CREATE OR REPLACE FORCE VIEW "user"."USERS" ("PROFILE_ID", "USER_NAME", "FIRST_NAME", "LAST_NAME", "LOCATION", "URL")
AS
  SELECT n_user_profile_id,
    c_user_name,
    c_first_name,
    c_last_name,
    LOCATION,
    'http://localhost/login.cfm' AS url
  FROM user_profile;

thanks for your help.
CREATE OR REPLACE FORCE VIEW "user"."USERS" ("PROFILE_ID", "USER_NAME", "FIRST_NAME", "LAST_NAME", "LOCATION", "URL")
AS
  SELECT n_user_profile_id,
    c_user_name,
    c_first_name,
    c_last_name,
    LOCATION,
    'http://localhost/login.cfm' AS url
  FROM user_profile;

Open in new window

0
Comment
Question by:swathicfml
7 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
You need to recreate the view using the new 'string'.
0
 

Author Comment

by:swathicfml
Comment Utility
could you give me the command please?
0
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
Change it how?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
Comment Utility
>>could you give me the command please?

You posted it.

Assuming the URL you want is:  http://www.experts-exchange.com

CREATE OR REPLACE FORCE VIEW "user"."USERS" ("PROFILE_ID", "USER_NAME", "FIRST_NAME", "LAST_NAME", "LOCATION", "URL")
AS
  SELECT n_user_profile_id,
    c_user_name,
    c_first_name,
    c_last_name,
    LOCATION,
    'http://www.experts-exchange.com' AS url
  FROM user_profile;
0
 

Author Comment

by:swathicfml
Comment Utility
i need to change the url
'http://localhost/login.cfm' AS url to
'http://localhost1/login.cfm' AS url

0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 500 total points
Comment Utility
CREATE OR REPLACE FORCE VIEW "user"."USERS" ("PROFILE_ID", "USER_NAME", "FIRST_NAME", "LAST_NAME", "LOCATION", "URL")
AS
  SELECT n_user_profile_id,
    c_user_name,
    c_first_name,
    c_last_name,
    LOCATION,
    'http://localhost1/login.cfm' AS url
  FROM user_profile;
 
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
Comment Utility
Just for Clarification:
View is a object that store sql commands, not the results, therefore you cannot update view.
However, view can be recreated n number of times without effecting actual data.
More important is that if for some reason view gets invalidated, it automatically recompile on next access.
Even though view contains query, you can update the base tables (Conditions applied).
If you have heard that view contains data, that view is called Materialized view.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now