/*4。 function :校驗單證是否可以回銷
parameter : p_formno 單證號
p_institutionno 機構**前兩位
p_rtn_rcptno 業務單號
p_flag 是否可以回銷標誌,y——可以回銷,n——不可以回銷
p_message 錯誤資訊返回
*/procedure formno_writeoff_check(p_formno in varchar2,
p_institutionno in varchar2,
p_rtn_rcptno in varchar2,
p_flag in out varchar2,
p_message in out varchar2) is
v_instno value_voucher_record.institution_no%type;
v_sup2instno value_voucher_record.institution_no%type;
cursor cur_value_voucher_record is
select voucher_status, writeoff_billno, institution_no,end_receive_date
from value_voucher_record
where print_no = p_formno;
v_form_sts value_voucher_record.voucher_status%type;
v_rtn_rcptno value_voucher_record.writeoff_billno%type;
v_end_receive_date value_voucher_record.end_receive_date%type;
begin
dbms_output.put(p_flag);
p_message := null;
open cur_value_voucher_record;
loop
fetch cur_value_voucher_record
into v_form_sts, v_rtn_rcptno, v_instno,v_end_receive_date;
exit when cur_value_voucher_record%notfound;
proc_level2_instno(v_instno, v_sup2instno, p_message);
if p_message is null and substr(v_sup2instno, 0, 2) = p_institutionno then
if v_form_sts = '2' then
if nvl(v_rtn_rcptno, '@') <> p_rtn_rcptno and
p_rtn_rcptno is not null then
--p_message:= '此單證不能補印批單號為'||p_rtn_rcptno||'的單據!';
p_message := '此單證只能用於' || v_rtn_rcptno || '(已用)批單的補印';
elsif p_rtn_rcptno is null then
p_message := '此單證已處於回銷狀態,不能再回銷';
end if;
elsif v_form_sts = '1' then
p_message := null;
if (v_end_receive_date is not null and trunc(sysdate,'dd')>v_end_receive_date) then
p_message := '該單證有效期為'||to_char(v_end_receive_date,'yyyy-mm-dd')||',已過有效期,不能使用';
end if;
else
p_message := '單證不處於領用狀態,不能回銷';
end if;
return;
end if;
end loop;
if cur_value_voucher_record%notfound then
p_message := '未查找到此流水號資訊';
end if;
if p_message is null then
p_flag := 'y';
else
p_flag := 'n';
end if;
close cur_value_voucher_record;
end formno_writeoff_check;
乙個儲存過程
create or replace package abc zys is procedure daily census end abc zys 建乙個包,包中有儲存過程daily census。不涉及任何引數。create or replace package body abc zys is pro...
乙個儲存過程
首先是建立儲存過程.drop procedure if exists externalcalltocomplete delimiter create procedure externalcalltocomplete begin drop table if exists temp1 create ta...
乙個奇葩的需求
今天和朋友聊天突然給我說拍一下錄取通知書封面,一解釋原因原來是小夥伴碰到了乙個奇葩需求。拍攝內容 錄取通知書封面 拍攝要求 1 拍攝角度在通知書正上方,通知書要是原來的形狀,不要產生形變。主要內容為通知書,通知書邊上留一部分空白 2 最好用相機,用手機拍的話發原圖 3 拍攝時在明亮處拍攝,同時通知書...