Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how can i update a view in oracle?

Posted on 2011-09-14
7
Medium Priority
?
379 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
[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
7 Comments
 
LVL 77

Expert Comment

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

Author Comment

by:swathicfml
ID: 36536550
could you give me the command please?
0
 
LVL 52

Expert Comment

by:_agx_
ID: 36536553
Change it how?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 36536565
>>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
ID: 36536567
i need to change the url
'http://localhost/login.cfm' AS url to
'http://localhost1/login.cfm' AS url

0
 
LVL 77

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 2000 total points
ID: 36536575
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
ID: 36536620
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
What You Need to Know when Searching for a Webhost Provider
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

722 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