create or replace function fun_get_Repeal_value(systemvalue varchar)
return varchar as
v_reason_conten varchar(1000);
cursor cur is
select distinct dm
from zzdxb
where instr(systemvalue,dmmc)>0;
begin
v_reason_conten:='';
for cur_re in cur loop
v_reason_conten:=v_reason_conten||cur_re.dm;
end loop;
return v_reason_conten;
end;
已知‘男’获取性别字典ZZDXB中的ID
执行select fun_get_Repeal_value('男') from dual
此类问题用来解决大批量查询或者单个查询。
大多数情况下:我们已知一个表的中文值需要获取它对应的ID,非常实用。