The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT chr.template_yn,
chr.currency_code,
chr.start_date,
chr.end_date,
khr.deal_type,
khr.term_duration,
nvl(rpar.base_rate, 10) base_rate
FROM okc_k_headers_b chr,
okl_k_headers khr,
OKL_K_RATE_PARAMS rpar
WHERE khr.id = p_khr_id
AND chr.id = khr.id
AND rpar.khr_id(+) = khr.id;
SELECT cle.id, sty.stream_type_purpose,
NVL(kle.capital_amount,0) capital_amount,
NVL(kle.residual_value, 0) residual_value
FROM okc_rule_groups_b rgp,
okc_rules_b rul1,
okc_k_lines_b cle,
okl_k_lines kle,
okc_line_styles_b lse,
okl_strm_type_b sty
WHERE rul1.dnz_chr_id = p_khr_id
AND rul1.rule_information_category = 'LASLH'
AND rul1.rgp_id = rgp.id
AND rgp.cle_id = cle.id
AND cle.sts_code in ('INCOMPLETE','ENTERED','NEW')
AND cle.id = kle.id
AND cle.lse_id = lse.id
AND lse.lty_code = 'FREE_FORM1'
AND sty.id = to_number(rul1.object1_id1)
AND (sty.stream_type_purpose = 'RENT'
or sty.stream_type_purpose = 'DOWN_PAYMENT');
SELECT NVL(precision,0)
INTO l_precision
FROM fnd_currencies
WHERE currency_code = l_hdr_csr_rec.currency_code;
l_asset_id_tbl.delete;
l_total_rent_inflow_tbl.delete;
lx_total_rent_inflow_tbl.delete;
SELECT rgp.cle_id cle_id, sty.stream_type_purpose, sty.id sty_id,
FND_DATE.canonical_to_date(sll.rule_information2) start_date,
TO_NUMBER(SLL.rule_information3) periods,
sll.object1_id1 frequency,
sll.rule_information5 structure,
NVL(sll.rule_information10, 'N') arrears_yn,
DECODE(sll.object1_id1, 'M', 30, 'Q', 120, 'S', 180, 'A', 360) days_per_period,
DECODE(sll.object1_id1, 'M', 12, 'Q', 4, 'S', 2, 'A', 1) periods_per_year,
DECODE(sll.object1_id1, 'M', 1, 'Q', 3, 'S', 6, 'A', 12) months_per_period,
FND_NUMBER.canonical_to_number(sll.rule_information6) amount,
TO_NUMBER(sll.rule_information7) stub_days,
TO_NUMBER(sll.rule_information8) stub_amount
FROM okc_rules_b sll,
okc_rules_b slh,
okc_rule_groups_b rgp,
okl_strm_type_b sty
WHERE rgp.dnz_chr_id = p_khr_id
AND rgp.cle_id = p_kle_id
AND rgp.rgd_code= 'LALEVL'
AND rgp.id = slh.rgp_id
AND slh.rule_information_category = 'LASLH'
AND TO_NUMBER(slh.object1_id1) = sty.id
AND sty.version = '1.0'
AND (sty.stream_type_purpose = 'RENT'
or sty.stream_type_purpose = 'DOWN_PAYMENT')
AND TO_CHAR(slh.id) = sll.object2_id1
AND sll.rule_information_category = 'LASLL'
ORDER BY fnd_date.canonical_to_date(sll.rule_information2);
l_rent_inflow_tbl.delete;
lx_rent_inflow_tbl.delete;