Solved

how can i update a view in oracle?

Posted on 2011-09-14
7
375 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 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run ColdFusion website locally 1 31
Procedure syntax 5 39
Help with Oracle IF statment 5 26
grant privilege to execute a procedure for user in another database 20 22
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

831 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