Link to home
Start Free TrialLog in
Avatar of swathicfml
swathicfml

asked on

how can i update a view in oracle?

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

Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

You need to recreate the view using the new 'string'.
Avatar of swathicfml

ASKER

could you give me the command please?
Change it how?
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i need to change the url
'http://localhost/login.cfm' AS url to
'http://localhost1/login.cfm' AS url

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.