type CLMTABLE is table of varchar2(100) index by varchar2(1000);
t_SCLM CLMTABLE;
t_KCLM CLMTABLE;
begin
t_SCLM.delete;
t_KCLM.delete;
for rec_clm in (select * from cfg_lov_map) loop
t_SCLM(rec_clm.src_id || rec_clm.src_type || rec_clm.src_code) := rec_clm.sib_code;
t_KCLM(rec_clm.src_id || rec_clm.src_type || rec_clm.src_code) := rec_clm.ken_code;
end loop;
function fun_val_clm(p_SrcID varchar2,
p_SrcType varchar2,
p_SrcCode varchar2,
p_Domain varchar2) return varchar2 is begin
case p_Domain
when 'SK' then
if t_SCLM(p_SrcID || p_SrcType || p_SrcCode) is null or
t_KCLM(p_SrcID || p_SrcType || p_SrcCode) is null then
return 'FAILED';
else
return t_KCLM(p_SrcID || p_SrcType || p_SrcCode);
end if; when 'S' then
if t_SCLM(p_SrcID || p_SrcType || p_SrcCode) is null then
return 'FAILED';
else
return t_SCLM(p_SrcID || p_SrcType || p_SrcCode);
end if; when 'K' then
if t_KCLM(p_SrcID || p_SrcType || p_SrcCode) is null then
return 'FAILED';
else
return t_KCLM(p_SrcID || p_SrcType || p_SrcCode);
end if;
end case;
exception
when no_data_found then
return 'FAILED';
when others then
raise;
end fun_val_clm;
我的问题是: t_SCLM(rec_clm.src_id || rec_clm.src_type || rec_clm.src_code) := rec_clm.sib_code;这句话是什么意思?
t_SCLM CLMTABLE;
t_KCLM CLMTABLE;
begin
t_SCLM.delete;
t_KCLM.delete;
for rec_clm in (select * from cfg_lov_map) loop
t_SCLM(rec_clm.src_id || rec_clm.src_type || rec_clm.src_code) := rec_clm.sib_code;
t_KCLM(rec_clm.src_id || rec_clm.src_type || rec_clm.src_code) := rec_clm.ken_code;
end loop;
function fun_val_clm(p_SrcID varchar2,
p_SrcType varchar2,
p_SrcCode varchar2,
p_Domain varchar2) return varchar2 is begin
case p_Domain
when 'SK' then
if t_SCLM(p_SrcID || p_SrcType || p_SrcCode) is null or
t_KCLM(p_SrcID || p_SrcType || p_SrcCode) is null then
return 'FAILED';
else
return t_KCLM(p_SrcID || p_SrcType || p_SrcCode);
end if; when 'S' then
if t_SCLM(p_SrcID || p_SrcType || p_SrcCode) is null then
return 'FAILED';
else
return t_SCLM(p_SrcID || p_SrcType || p_SrcCode);
end if; when 'K' then
if t_KCLM(p_SrcID || p_SrcType || p_SrcCode) is null then
return 'FAILED';
else
return t_KCLM(p_SrcID || p_SrcType || p_SrcCode);
end if;
end case;
exception
when no_data_found then
return 'FAILED';
when others then
raise;
end fun_val_clm;
我的问题是: t_SCLM(rec_clm.src_id || rec_clm.src_type || rec_clm.src_code) := rec_clm.sib_code;这句话是什么意思?
解决方案 »
- oracle 10g 升级到oracle 11g sql报错,跪求大神解答
- DB2 9.5不兼容win7吗?
- oracle用一个语句中列出2012年每月第二周星期二的日期
- 【求助】Pro*C/C++预编译一直通不过
- 散分:Oracle支持多线程技术从哪个版本开始
- oracle的存储问题
- 如何提升查找符合条件后的前n条记录的效率?
- oracle 连接问题
- 请问oracle在window 2000 server为什么安装不成功?
- 请问在Oracle中的数据类型(BLOB,CLOB)在Mircosoft SQL Server中是对应什么类型?
- 请教,将MS-SQL 转换为Orcale 多谢啦
- OCI 批量处理BLOB locator问题。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
三个字段连接起来
在Oracle9iRelease 2以后index 可以使用Varchar2.以前是使用BINARY_INTEGER的.
type ename_table_type is table of emp.ename%type index by binary_integer所谓的可变数组是指: Varray,也较变长数组, 语法是这样的:
Create type varray_emp as VARRAY(100) OF emp%rowtype
可以把这种表理解为一个MAP,在这种数据结构中,是以键-值对存储的。
在上面的例子中,它的值就是varchar2(100)这个长度,键就是varchar2(1000)长度,
即在 t_SCLM(rec_clm.src_id ¦ ¦ rec_clm.src_type ¦ ¦ rec_clm.src_code) := rec_clm.sib_code;这句话里面,
rec_clm.src_id ¦ ¦ rec_clm.src_type ¦ ¦ rec_clm.src_code连接起来作为键,长度小于1000,
rec_clm.sib_code是值,长度小于100.不知道我的理解是否正确,请各位大侠不吝指教!!!!!1