0% found this document useful (0 votes)
105 views

Ar Amount Script

This document contains the body of a package that handles account freezing and unfreezing. It defines a procedure called FIN_FREEZE_PROC that takes in input parameters and returns output parameters. The procedure opens a cursor to retrieve account information. It then checks whether the request is to freeze or unfreeze the account and performs the appropriate database updates and selections, setting the output parameters accordingly. These output parameters are formatted into a single output record that is returned.

Uploaded by

jake
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

Ar Amount Script

This document contains the body of a package that handles account freezing and unfreezing. It defines a procedure called FIN_FREEZE_PROC that takes in input parameters and returns output parameters. The procedure opens a cursor to retrieve account information. It then checks whether the request is to freeze or unfreeze the account and performs the appropriate database updates and selections, setting the output parameters accordingly. These output parameters are formatted into a single output record that is returned.

Uploaded by

jake
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

CREATE OR REPLACE PACKAGE BODY CUSTOM.

FIN_FREEZE_SLIP_PACK
as
AccountNumber tbaadm.GAM.FORACID%type;
FreezeTag varchar2(10);

Cursor DMS522 is
SELECT NVL(FREZ_CODE,'N'), ACID, ACCT_NAME FROM TBAADM.GAM WHERE FORACID
=AccountNumber
;

Procedure FIN_FREEZE_PROC
(
inp_str IN VARCHAR2,
out_retcode OUT NUMBER,
out_rec OUT VARCHAR2
)
AS
vFrezCode tbaadm.GAM.Frez_Code%Type;
vACID tbaadm.GAM.ACID%type;
vAcctName tbaadm.GAM.ACCT_NAME%Type;
vReasonCode varchar2(40);
vFrezRem varchar2(350);
vLastFrezDate tbaadm.GAM.LAST_FREZ_DATE%Type;
vLastUnFrezDate tbaadm.GAM.LAST_UNFREZ_DATE%Type;
vFrezMsg varchar2(50);
vEnteredID varchar2(30);
vAuditSOLID tbaadm.audit_table.audit_sol_id%type;
vAuditDate tbaadm.audit_table.audit_date%type;
loc_outarr tbaadm.basp0099.arraytype;

BEGIN
out_rec := NULL;
out_retcode := 0;
tbaadm.basp0099.forminputarr (inp_str, loc_outarr);
AccountNumber:=loc_outarr(0);
FreezeTag:=loc_outarr(1);

IF (NOT DMS522%ISOPEN)
Then
Open DMS522;
End If;
IF (DMS522%ISOPEN)
THEN FETCH DMS522 INTO vFrezCode, vACID, vAcctName
;
--vLastUnFrezDate:=''; vFrezCode:='N';
--REQUEST TO FREEZE ACCOUNT
IF (FreezeTag='FREEZE') THEN
if (vFrezCode='N') then
AccountNumber:=''; vFrezCode:='';
vAcctName:='ACCOUNT IS NOT FROZEN';

vACID:='';vReasonCode:='';vFrezRem:='';vLastFrezDate:='';
vEnteredID:='';vAuditSOLID:='';vAuditDate:='';
else
Begin
SELECT G.FREZ_REASON_CODE||' / '||
g.FREZ_REASON_CODE_2||' / '||FREZ_REASON_CODE_3||' / '||FREZ_REASON_CODE_4||' / '||
FREZ_REASON_CODE_5 ,
C.FREEZE_RMKS||' / '||c.FREEZE_RMKS2||' /
'||c.FREEZE_RMKS3||' / '||c.FREEZE_RMKS4||' / '||c.FREEZE_RMKS5,
G.LAST_FREZ_DATE
into vReasonCode,vFrezRem,vLastFrezDate
FROM TBAADM.GAM G, TBAADM.GAC C
WHERE FORACID = AccountNumber
AND G.ACID = C.ACID;
exception when no_data_found then
vAcctName:='';
vACID:='';vReasonCode:='';vFrezRem:='';vLastFrezDate:='';
End;
Begin
SELECT ENTERER_ID||'-'||AUTH_ID ,
AUDIT_SOL_ID, AUDIT_DATE
into vEnteredID, vAuditSOLID,
vAuditDate
FROM TBAADM.AUDIT_TABLE
WHERE AUDIT_DATE = (SELECT
MAX(AUDIT_DATE)
FROM
TBAADM.AUDIT_TABLE
WHERE ACID =
vACID
AND
(MODIFIED_FIELDS_DATA LIKE ('%_reason_code__||%') or MODIFIED_FIELDS_DATA LIKE
('%_reason_code||%')))
AND MOP_ID = 'HAFSM'
AND AUTH_ID IS NOT NULL
AND ACID = vACID
AND (MODIFIED_FIELDS_DATA LIKE
('%_reason_code__||%') or MODIFIED_FIELDS_DATA LIKE ('%_reason_code||%'));
exception when no_data_found then

vEnteredID:='';vAuditSOLID:='';vAuditDate:='';
End;
End if;
--REQUEST TO UNFREEZE ACCOUNT
ELSE
if ((vFrezCode='N') or vFrezCode is not null) then
Begin
SELECT G.FREZ_REASON_CODE||' / '||
g.FREZ_REASON_CODE_2||' / '||FREZ_REASON_CODE_3||' / '||FREZ_REASON_CODE_4||' / '||
FREZ_REASON_CODE_5||'-Released',
C.FREEZE_RMKS||' / '||c.FREEZE_RMKS2||' /
'||c.FREEZE_RMKS3||' / '||c.FREEZE_RMKS4||' / '||c.FREEZE_RMKS5,
G.LAST_UNFREZ_DATE
into vReasonCode,vFrezRem,vLastUnFrezDate
FROM TBAADM.GAM G, TBAADM.GAC C
WHERE FORACID = AccountNumber
AND G.ACID = C.ACID;
exception when no_data_found then
vAcctName:='';
vACID:='';vReasonCode:='';vFrezRem:='';vLastUnFrezDate:='';
End;
Begin
SELECT ENTERER_ID||'-'||AUTH_ID ,AUDIT_SOL_ID,
AUDIT_DATE
into vEnteredID, vAuditSOLID, vAuditDate
FROM TBAADM.AUDIT_TABLE
WHERE AUDIT_DATE = ( SELECT MAX(AUDIT_DATE)
FROM TBAADM.AUDIT_TABLE
WHERE
((MODIFIED_FIELDS_DATA LIKE ('%_reason_code__|%||')) or (MODIFIED_FIELDS_DATA LIKE
('%_reason_code|%||')))
AND MOP_ID = 'HAFSM'
AND AUTH_ID IS NOT NULL
AND ACID = vACID)
AND MOP_ID = 'HAFSM'
AND ACID = vACID
AND ((MODIFIED_FIELDS_DATA LIKE
('%_reason_code__|%||')) or (MODIFIED_FIELDS_DATA LIKE ('%_reason_code|%||')));
exception when no_data_found then
vEnteredID:='';vAuditSOLID:='';vAuditDate:='';
End;
else
AccountNumber:=''; vFrezCode:='';
vAcctName:='ACCOUNT IS FROZEN';
vACID:='';vReasonCode:='';vFrezRem:='';vLastFrezDate:='';
vEnteredID:='';vAuditSOLID:='';vAuditDate:='';
End if;
END IF;

IF (DMS522%FOUND)
THEN
out_rec :=(
AccountNumber||'|'||
vAcctName||'|'||
vFrezCode||'|'||
vReasonCode||'|'||
vFrezRem||'|'||
vLastFrezDate||'|'||
vLastUnFrezDate||'|'||
vEnteredID||'|'||
vAuditSOLID||'|'||
vFrezMsg||'|'|| --?
vAuditDate
);
ELSE
Close DMS522;
Out_RetCode:=1;
RETURN;
END IF;
END IF;
end FIN_FREEZE_PROC;
end FIN_FREEZE_SLIP_PACK;
/

You might also like