2019-11-08
oracle-apex pl/sql报错
第72行第FN_GETBASE64没有定义怎么回事?

p_item in apex_plugin.t_page_item, -- Holds item name, label and custom attributes
p_plugin in apex_plugin.t_plugin, -- The plugin name
p_value in varchar2, -- Is the field value of the item
p_is_readonly in boolean, -- Should the item be readonly
p_is_printer_friendly in boolean
)
return apex_plugin.t_page_item_render_result
IS
num01 number;
num02 number;
tmpNum number;
opCode number;
opName VARCHAR2(30);
opName_img clob;
op VARCHAR2(30);
-- Apex mandates that the PLSQL render function for a plugin returns apex_plugin.t_page_item_render_result.
l_result apex_plugin.t_page_item_render_result;
v_width number:=p_item.element_width;
v_type number := p_item.attribute_01;
v_SUBMIT VARCHAR2(200) := p_item.attribute_02;
lv_string varchar2(32676);
v_captchaValue varchar2(100);
BEGIN
if not apex_collection.collection_exists('APEXCAPTCHA_RESAULT') then
apex_collection.create_collection('APEXCAPTCHA_RESAULT');
end if;
IF v_SUBMIT='Y' THEN
v_SUBMIT:='onkeypress="return apex.submit({request:'''||p_item.name||''',submitIfEnter:event})"';
ELSE
v_SUBMIT:='';
END IF;
num01:=round(dbms_random.value(0,10));
num02:=round(dbms_random.value(0,10));
opCode:=round(dbms_random.value(1,3));
if opCode=1 then
opName:='plus';
op:='+';
elsif opCode=2 then
opName:='multiplied by';
op:='*';
else
if num01<num02 then
tmpNum:=num01;
num01:=num02;
num02:=tmpNum;
end if;
opName:='minus';
op:='-';
end if;
htp.p('<input type="text" '||v_SUBMIT||' autocomplete="off" style="direction:ltr; order:1; text-align:center" name="'||p_item.name||
'" id="'||p_item.name||'" required=""'||
'size="'||v_width||'" '||
'maxlength="2" '||
'class="text_field apex-item-text apex-item-has-icon '||p_item.element_css_classes||'" '||
p_item.element_attributes||
'/>');
if v_type=1 then
opName_img:=FN_GETBASE64(num01||' '||op||' '||num02);
htp.p('<img src="'||opName_img||'" style="order:2;width:80px;height:30px">');
else
htp.p(num01 ||' '||opName||' '|| num02);
end if;
if p_item.icon_css_classes is not null then
htp.p('<span class="apex-item-icon fa '||p_item.icon_css_classes||'" aria-hidden="true"></span>');
end if;
execute immediate 'select '||num01||op||num02||' from dual' INTO v_captchaValue ;
APEX_COLLECTION.TRUNCATE_COLLECTION ( 'APEXCAPTCHA_RESAULT');
apex_collection.add_member(
p_collection_name => 'APEXCAPTCHA_RESAULT',
p_c001 => v_captchaValue
);
RETURN l_result;
END render_captcha ;
FUNCTION validate_captcha (
p_item IN APEX_PLUGIN.t_page_item,
p_plugin IN APEX_PLUGIN.t_plugin,
p_value IN VARCHAR2)
RETURN APEX_PLUGIN.t_page_item_validation_result
IS
l_result apex_plugin.t_page_item_validation_result;
v_captchaValue varchar2(200);
BEGIN
BEGIN
select nvl(C001,1) into v_captchaValue
from apex_collections
where collection_name = 'APEXCAPTCHA_RESAULT';
IF upper(v_captchaValue) = upper(p_value) THEN
return l_result;
ELSE
l_result.message := 'wrong captcha!';
return l_result;
END IF;
EXCEPTION WHEN OTHERS THEN
l_result.message := 'captcha exception Error!';
return l_result;
END;
RETURN l_result;
END validate_captcha;
我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏

评论
