If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

CURSOR CURS_MOVEMENT IS
SELECT contract_id, sum(movement_fc_amt) as TOTAL_FEE_AMT
FROM th_deposit_contract_movements
where ACCOUNTING_DAT between LV_FRST_DAY_MTH and LV_LST_DAY_MTH
and STANDARD_TEXT_COD = 'CT07'
and ACCOUNTING_TYPE = '01'
group by contract_id;

CURSOR CURS_COUNT_SECACC IS
SELECT COUNT(*) as NUMBER_OF_SECURITY_ACCOUNT
FROM th_deposit_contract_dim TDCD,
th_deposit_balance_month TDBM
WHERE TDCD.ORI_SEC_CAP_PRODUCT = '00'
AND TDCD.LINK_CONTRACT_ID is not null
AND tdcd.STATUS_DESCR = 'OPEN'
AND TDCD.BLOCKADE_COD = '00'
AND TDCD.DEPO_CONTRACT_DIM_IDN = TDBM.DEPO_CONTRACT_DIM_IDN
AND TDBM.BALANCE_DAT = LV_LST_DAY_PREV_YEAR
AND TDBM.BALANCE_LC_AMT > 0
AND TDCD.LINK_CONTRACT_ID in (LV_CNTRCT_ID)
group by TDCD.CONTRACT_ID;

CURSOR CURS_SPLIT_AMT IS
SELECT TDCD.CONTRACT_ID as SECURITY_ACCOUNT
FROM TH_DEPOSIT_CONTRACT_DIM TDCD,
TH_DEPOSIT_BALANCE_MONTH TDBM
WHERE TDCD.ORI_SEC_CAP_PRODUCT = '00'
AND TDCD.LINK_CONTRACT_ID is not null
AND tdcd.STATUS_DESCR = 'OPEN'
AND TDCD.BLOCKADE_COD = '00'
AND TDCD.DEPO_CONTRACT_DIM_IDN = TDBM.DEPO_CONTRACT_DIM_IDN
AND TDBM.BALANCE_DAT = LV_LST_DAY_PREV_YEAR
AND TDBM.BALANCE_LC_AMT > 0
AND TDCD.LINK_CONTRACT_ID in (LV_CNTRCT_ID);