首页 > 代码库 > Merge Into ----using table to keep properties contents
Merge Into ----using table to keep properties contents
When there are some property contents we want to keep, usually, we can use Property table to keep them.
- Create one table with two fields: one is identifier (key), the other is value (value) key : value
CREATE TABLE properties_bvoip3 (identifier VARCHAR2 (4000), value VARCHAR2 (4000)) ;
2.Insert data to property table
merge into properties_bvoip3 pusing (select ‘one_key‘ identifier, ‘one_value‘ value from dual) son (p.identifier = s.identifier)when matched then update set p.value = s.valuewhen not matched then insert (identifier,value) values (s.identifier, s.value);
3.Get the value of one key from property table
1).Create one function to get value
create or replace function get_property_bvoip3( p_key Varchar2(4000)) return varchar2 asl_tmp varchar2(4000);begin select value into l_tmp from properties_bvoip3 where p_key=identifier; return l_tmp; exception when others then return null;end;/
2).Get value
l_value := get_property_bvoip3(‘one_key‘);
Merge Into ----using table to keep properties contents
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。