Solved

how can i update a view in oracle?

Posted on 2011-09-14
7
377 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 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 500 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
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.

728 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