Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Created September 22, 2012 15:06
Show Gist options
  • Save shaik2many/3766460 to your computer and use it in GitHub Desktop.
Save shaik2many/3766460 to your computer and use it in GitHub Desktop.
oracle-virtual column
ALTER TABLE tcom_asset DROP COLUMN asset_name
ALTER TABLE Tcom_Project_Bus_Subbus
ADD BUSINESS_DESC VARCHAR2(4000) GENERATED ALWAYS AS (get_business_by_id(sub_business_id)) VIRTUAL;
create or replace function get_business_by_id(p_business_id in varchar2) return varchar2 DETERMINISTIC is
ret varchar2(255);
begin
select business_desc into ret from MVGLD_BUSINESS where business_code = p_business_id;
return ret;
end get_business_by_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment