function check_actionata(p_actionata defect.actionata%type, p_actype orders.actype%type, p_return out varchar2) return number is l_count number; begin if trim(p_actionata) is null then p_return := null; return 1; end if; if trim(p_actype) is null then select count(ata) into l_count from ata where trim(ata) = trim(p_actionata) and not_for_defect is null; else select count(ata) into l_count from ata where trim(actype) = trim(p_actype) and trim(ata) = trim(p_actionata) and not_for_defect is null; end if; if l_count = 0 then p_return := zh_pub_function.get_message('DEFECT', -7); return 0; end if; p_return := null; return 1; end check_actionata;
调用函数:
if dwo.name = 'ata' then data = trim(data) ls_actype = trim(ls_actype) ls_return = trim(ls_return) sqlca.check_actionata( data, ls_actype, ls_return) messagebox('提示',sqlca.sqlerrtext) if trim(ls_return) <>'' then else messagebox('提示',ls_return) end if end if