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;
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;
You need to recreate the view using the new 'string'.
ASKER
could you give me the command please?
Change it how?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i need to change the url
'http://localhost/login.cfm' AS url to
'http://localhost1/login.cfm' AS url
'http://localhost/login.cfm' AS url to
'http://localhost1/login.cfm' AS url
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.