Lable:LOOP
IF i > (14) THEN
LEAVE lable;
ELSE -- 3>开始分析,先得到操作ID
case i
when 1 then set iEvent_Attr_Id:=80 ; -- 呼叫类型
when 2 then set iEvent_Attr_Id:=3 ; -- 事件
when 3 then set iEvent_Attr_Id:=7 ; -- 主叫区号 ;
when 4 then set iEvent_Attr_Id:=8 ; -- 主叫号码
when 5 then set iEvent_Attr_Id:=13 ; -- 被叫区号
when 6 then set iEvent_Attr_Id:=14 ; -- 被叫号码
when 7 then set iEvent_Attr_Id:=21 ; -- 通话时间
when 8 then set iEvent_Attr_Id:=23 ; -- 通话时长
when 9 then set iEvent_Attr_Id:=36 ; -- ServId when 10 then set iEvent_Attr_Id:=4 ; -- BILLING_AREA_CODE
when 11 then set iEvent_Attr_Id:=5 ; -- BILLING_NBR
when 12 then set iEvent_Attr_Id:=1046; -- acct_id1
when 13 then set iEvent_Attr_Id:=1059; -- offer_instance_id1
when 14 then set iEvent_Attr_Id:=1065; -- sum_amount
else
call PK_Pricing_Result_Data_throw(1, '发生错误了.标准话单超出范围');
end case; -- 4>得到字段名
select Field_name,re into sFieldName,sRe
from parse_event_attr_to_fileld
where Event_Attr_Id = iEvent_Attr_Id; select iEvent_Attr_Id,Field_name;目前遇到的问题是,在获取字段名时,传入的iEvent_Attr_Id在表parse_event_attr_to_fileld中没有记录时,也会取到一个错误的Field_name,而不是得到null值。求帮助分析下,谢谢。
IF i > (14) THEN
LEAVE lable;
ELSE -- 3>开始分析,先得到操作ID
case i
when 1 then set iEvent_Attr_Id:=80 ; -- 呼叫类型
when 2 then set iEvent_Attr_Id:=3 ; -- 事件
when 3 then set iEvent_Attr_Id:=7 ; -- 主叫区号 ;
when 4 then set iEvent_Attr_Id:=8 ; -- 主叫号码
when 5 then set iEvent_Attr_Id:=13 ; -- 被叫区号
when 6 then set iEvent_Attr_Id:=14 ; -- 被叫号码
when 7 then set iEvent_Attr_Id:=21 ; -- 通话时间
when 8 then set iEvent_Attr_Id:=23 ; -- 通话时长
when 9 then set iEvent_Attr_Id:=36 ; -- ServId when 10 then set iEvent_Attr_Id:=4 ; -- BILLING_AREA_CODE
when 11 then set iEvent_Attr_Id:=5 ; -- BILLING_NBR
when 12 then set iEvent_Attr_Id:=1046; -- acct_id1
when 13 then set iEvent_Attr_Id:=1059; -- offer_instance_id1
when 14 then set iEvent_Attr_Id:=1065; -- sum_amount
else
call PK_Pricing_Result_Data_throw(1, '发生错误了.标准话单超出范围');
end case; -- 4>得到字段名
select Field_name,re into sFieldName,sRe
from parse_event_attr_to_fileld
where Event_Attr_Id = iEvent_Attr_Id; select iEvent_Attr_Id,Field_name;目前遇到的问题是,在获取字段名时,传入的iEvent_Attr_Id在表parse_event_attr_to_fileld中没有记录时,也会取到一个错误的Field_name,而不是得到null值。求帮助分析下,谢谢。
你有初始化一下 Field_name 变量的值吗