我正在像PLSQL中的正常过程一样以oracle形式编辑过程,其中在过程结束时我要创建一个新条件,当count = 0时调用另一个过程,否则就继续执行
我终于在iam编辑的过程中尝试了此块
select count(*) into cnt_num from Af900MB where BRN_CD = :global.br_cd
and KEY1 = 'SCONC_EXCLUSION_BOR_CAT'
and KEY2 = 'Variable '
and PARAM_VAL = 'Y';
if cnt_num = 0 then
*****
elsif cnt_num <> 0 then
****
end if
end;
但是我不知道如果..或者如果..或者我不知道这是否正确
下面是我的整个过程,我的编辑是该过程的最后一个
NAME = proc_scrip
DEFINITION = <<<
procedure proc_scrip is
begin
declare
newline_amt number(15,2);
cnt_num number;
begin
:global.form_status := 'TRUE';
:global.option := 'A';
:global.brn_cd := :global.env_br_cd;
:global.oldcpv := :read_af008tb.cpv;
:global.oldncpv := :read_af008tb.ncpv;
:global.oldncpv_restr := :read_af008tb.ncpv_restr;
:global.oldline_amt := :read_af008tb.line_amt;
:global.run_dt := to_char(:header.run_dt,'dd-mm-yyyy');
:global.scrp_conc_flag := 'N';
:global.cst_name := :read_af008tb.nm1;
:global.prod := '01';
call(:global.env_bin1 || 'af001ft_2',no_hide);
if :global.form_status = 'FALSE' then --1
message('Cpv Computation not posted ..');
clear_form(no_validate,full_rollback);
pass_control;
else
select line_amt into newline_amt from af008tb where
acc_no = :global.rusa_acc_no and
mkr_dt = :header.run_dt and
act_cd = :global.act_cd and
srl_no = :global.prod_ref_no and
brn_cd = :global.brn_cd;
update AF008TB
set auth_st = 'A',
auth_id = 'SYSTEM',
auth_dt = :header.run_dt
where acc_no = :global.rusa_acc_no and
mkr_dt = :header.run_dt and
act_cd = :global.act_cd and
srl_no = :global.prod_ref_no and
brn_cd = :global.brn_cd;
if sql%rowcount = 0 then --2
message('Unable to authorise af008tb ........');
pause;
clear_form(no_validate,full_rollback);
pass_control;
else
declare
amt_diff number(15,2) ;
with_amt number(15,2) ;
error number(5) ;
error_txt varchar2(100) ;
AA180PT_ERROR exception ;
begin
ct030pq(:global.brn_cd,:read_af008tb.acc_no,
with_amt,error,error_txt);
amt_diff:=newline_amt - to_number(:global.oldline_amt);
if amt_diff != 0 and
to_date(:global.line_mat_dt,'dd-mm-yyyy') >= :header.run_dt then
aa180pt(:global.brn_cd ,:read_af008tb.acc_no,
:header.run_dt,8,'0',amt_diff,
'D',:header.run_dt,error, error_txt) ;
if error != 0 then
raise AA180PT_ERROR ;
end if ;
end if;
exception
when form_trigger_failure then
raise form_trigger_failure;
when NO_DATA_FOUND then
message('select error on af008tb ....');
pause;
clear_form(no_validate,full_rollback);
pass_control;
when AA180PT_ERROR then
message('aa180pt_error'||error_txt);
pause;
clear_form(no_validate,full_rollback);
pass_control;
when OTHERS then
message('select error on af008tb ....');
pause;
clear_form(no_validate,full_rollback);
pass_control;
end;
:global.newline_amt := newline_amt;
call_af808pb;
CmeCheck;
update AF020MB
set line_amt = newline_amt
where brn_cd = :global.brn_cd and
acc_no = :global.rusa_acc_no;
if sql%rowcount = 0 then --3
message('Unable to update line amount in af020mb ....');
pause;
clear_form(no_validate,full_rollback);
pass_control;
else
update AF001MB set
(CPV,CPV_NON_GOVT,CPV_GOVT,NCPV,NCPV_GOVT,NCPV_NON_GOVT,
NCPV_CRI_GOVT,NCPV_CRI_NON_GOVT,NCPV_RESTR) =
(select CPV,CPV_NON_GOVT,CPV_GOVT,NCPV,NCPV_GOVT,
NCPV_NON_GOVT,NCPV_CRI_GOVT,NCPV_CRI_NON_GOVT,
NCPV_RESTR from af008tb where acc_no = af001mb.acc_no
and mkr_dt = :header.run_dt and act_cd = :global.act_cd
and srl_no = :global.prod_ref_no and
brn_cd = :global.brn_cd)
WHERE acc_no = :global.rusa_acc_no and
brn_cd = :global.brn_cd;
if sql%rowcount = 0 then --4
message('Unable to update customer master af001mb ....');
pause;
clear_form(no_validate,full_rollback);
pass_control;
else
begin
scrp_rate_upd;
insert into AF010TB
(BRN_CD, ACC_SCRP_CD, INT_ACT_CD)
values
(:global.env_br_cd, :read_af008tb.acc_no, '2');
exception
when dup_val_on_index then
null;
end;
begin
select count(*) into cnt_num from Af900MB where BRN_CD = :global.br_cd
and KEY1 = 'SCONC_EXCLUSION_BOR_CAT'
and KEY2 = <Global Variable for Borrower Category>
and PARAM_VAL = 'Y';
if cnt_num = 0 then
*****
elsif cnt_num <> 0 then
****
end if
end;
commit;
pass_control;
end if; --4
end if; --3
end if; --2
end if; --1
end;
end;
>>>
ENDDEFINE PROCEDURE
如果计数为0,则调用过程“ auth_proc”,否则按原样继续
答案 0 :(得分:2)
那将很简单
if cnt_num = 0 then
auth_proc;
end if;