The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT stm.kle_id contract_line_id,
stm.sty_id stream_type_id
FROM okl_streams stm,
okl_strm_type_b sty,
okc_k_lines_b kle,
okc_statuses_b kls,
okc_line_styles_b lse,
okl_strm_elements ste -- SECHAWLA 21-APR-03 2925120 :Added this table
WHERE stm.khr_id = cp_chr_id
AND stm.active_yn = 'Y'
AND stm.say_code = 'CURR'
AND ste.stm_id = stm.id -- SECHAWLA 21-APR-03 2925120 : Added this condition
AND ste.stream_element_date > cp_quote_eff_date -- SECHAWLA 21-APR-03 2925120 : Added this condition -- rmunjulu EDAT
AND sty.id = stm.sty_id
AND sty.billable_yn = 'Y'
--AND sty.capitalize_yn = 'N' -- SECHAWLA 04-MAR-03
AND kle.id = stm.kle_id
AND kls.code = kle.sts_code
AND kls.ste_code = 'ACTIVE'
AND lse.id = kle.lse_id
AND lse.lty_code IN (cp_top_style, cp_link_style)
GROUP BY stm.kle_id,
stm.sty_id;
SELECT stm.kle_id contract_line_id,
stm.sty_id stream_type_id,
kle.capital_amount line_payment
FROM okc_k_items ite,
okc_k_lines_b cle,
okl_k_lines_v kle,
okc_line_styles_b lse,
okl_streams stm,
okl_strm_type_b sty,
okl_strm_elements ste -- SECHAWLA 21-APR-03 2925120 :Added this table
WHERE ite.object1_id1 = cp_cle_id
AND cle.id = ite.cle_id
AND lse.id = cle.lse_id
AND lse.lty_code = cp_link_style
AND kle.id = cle.id
AND stm.kle_id = cle.id -- rmunjulu bug 4056186 Check with Cle.id NOT cle.cle_id
AND stm.khr_id = cp_chr_id
AND stm.active_yn = 'Y'
AND stm.say_code = 'CURR'
AND ste.stm_id = stm.id -- SECHAWLA 21-APR-03 2925120 : Added this condition
AND ste.stream_element_date > cp_quote_eff_date -- SECHAWLA 21-APR-03 2925120 : Added this condition -- rmunjulu EDAT
AND sty.id = stm.sty_id
AND sty.billable_yn = 'Y'
-- AND sty.capitalize_yn = 'N' -- SECHAWLA 04-MAR-03
GROUP BY stm.kle_id,
stm.sty_id,
kle.capital_amount;
SELECT sum (kle.capital_amount) total_payment
FROM okc_k_lines_b cle,
okl_k_lines_v kle,
okc_line_styles_b lse
WHERE cle.cle_id = cp_cle_id
AND lse.id = cle.lse_id
AND lse.lty_code = cp_link_style
AND kle.id = cle.id;
SELECT stm.kle_id contract_line_id,
stm.sty_id stream_type_id,
SUM (ste.amount) amount_due
FROM okl_streams stm,
okl_strm_elements ste,
okl_strm_type_b sty
WHERE stm.khr_id = cp_chr_id
AND stm.kle_id IS NULL
AND stm.active_yn = 'Y'
AND stm.say_code = 'CURR'
AND ste.stm_id = stm.id
-- AND ste.date_billed IS NULL -- rmunjulu EDAT FIXES Removed date billed as future bills are adjusted.
AND ste.stream_element_date > cp_quote_eff_date -- SECHAWLA 21-APR-03 2925120 :Added this condition -- rmunjulu EDAT
AND NVL (ste.amount, 0) <> 0
AND sty.id = stm.sty_id
AND sty.billable_yn = 'Y'
--AND sty.capitalize_yn = 'N' -- SECHAWLA 04-MAR-03
GROUP BY stm.kle_id,
stm.sty_id;
SELECT stm.kle_id contract_line_id,
stm.sty_id stream_type_id,
SUM (ste.amount) amount_due
FROM okl_streams stm,
okl_strm_elements ste,
okl_strm_type_b sty,
okc_k_lines_b kle,
okc_statuses_b kls,
okc_line_styles_b lse
WHERE stm.khr_id = cp_chr_id
AND stm.active_yn = 'Y'
AND stm.say_code = 'CURR'
AND ste.stm_id = stm.id
-- AND ste.date_billed IS NULL -- rmunjulu EDAT FIXES Removed date billed as future bills are adjusted.
AND ste.stream_element_date > cp_quote_eff_date -- SECHAWLA 21-APR-03 2925120 :Added this condition -- rmunjulu EDAT
AND NVL (ste.amount, 0) <> 0
AND sty.id = stm.sty_id
AND sty.billable_yn = 'Y'
--AND sty.capitalize_yn = 'N' -- SECHAWLA 04-MAR-03
AND kle.id = stm.kle_id
AND kls.code = kle.sts_code
AND kls.ste_code = 'ACTIVE'
AND lse.id = kle.lse_id
AND cp_exclude_styles NOT LIKE
'%' || G_SEP || lse.lty_code || G_SEP || '%'
GROUP BY stm.kle_id,
stm.sty_id;
SELECT stm.kle_id contract_line_id,
stm.sty_id stream_type_id,
SUM (ste.amount) amount_due
FROM okl_streams stm,
okl_strm_elements ste,
okl_strm_type_b sty
WHERE stm.khr_id = cp_chr_id
AND stm.kle_id = cp_cle_id
AND stm.active_yn = 'Y'
AND stm.say_code = 'CURR'
AND ste.stm_id = stm.id
-- AND ste.date_billed IS NULL -- rmunjulu EDAT FIXES Removed date billed as future bills are adjusted.
AND ste.stream_element_date > cp_quote_eff_date -- SECHAWLA 21-APR-03 2925120 :Added this condition -- rmunjulu EDAT
AND NVL (ste.amount, 0) <> 0
AND sty.id = stm.sty_id
AND sty.billable_yn = 'Y'
-- AND sty.capitalize_yn = 'N' -- SECHAWLA 04-MAR-03
GROUP BY stm.kle_id,
stm.sty_id;
SELECT stm.kle_id contract_line_id,
stm.sty_id stream_type_id,
SUM (ste.amount) amount_due
FROM okc_k_items ite,
okc_k_lines_b kle,
okc_line_styles_b lse,
okl_streams stm,
okl_strm_type_b sty,
okl_strm_elements ste
WHERE ite.object1_id1 = to_char(cp_cle_id) -- rmunjulu bug 5129653 need to_char as object1_id1 can be alphanumeric
AND kle.id = ite.cle_id
AND lse.id = kle.lse_id
AND cp_exclude_styles NOT LIKE
'%' || G_SEP || lse.lty_code || G_SEP || '%'
AND stm.kle_id = kle.id
AND stm.khr_id = cp_chr_id
AND stm.active_yn = 'Y'
AND stm.say_code = 'CURR'
AND sty.id = stm.sty_id
AND sty.billable_yn = 'Y'
--AND sty.capitalize_yn = 'N' -- SECHAWLA 04-MAR-03
AND ste.stm_id = stm.id
-- AND ste.date_billed IS NULL -- rmunjulu EDAT FIXES Removed date billed as future bills are adjusted.
AND ste.stream_element_date > cp_quote_eff_date -- SECHAWLA 21-APR-03 2925120 Added this condition -- rmunjulu EDAT
AND NVL (ste.amount, 0) <> 0
GROUP BY stm.kle_id,
stm.sty_id;
SELECT chr.sts_code
FROM OKC_K_HEADERS_B chr
WHERE chr.id = p_khr_id;
SELECT l.contract_line_id contract_line_id,
l.stream_type_id stream_type_id,
SUM (l.amount_due_remaining) amount_due
FROM okl_bpd_ar_inv_lines_v l --ansethur 01-MAR-2007 Added for R12 B Billing Architecture
-- FROM okl_bpd_leasing_payment_trx_v l --ansethur 01-MAR-2007 commented for R12 B Billing Architecture
WHERE l.CONTRACT_ID = cp_chr_id
AND NVL (l.amount_due_remaining, 0) <> 0
GROUP BY l.contract_line_id,
l.stream_type_id; */
SELECT l.contract_line_id contract_line_id,
l.stream_type_id stream_type_id,
SUM (l.amount_due_remaining) amount_due
FROM okl_bpd_ar_inv_lines_v l
, OKC_K_HEADERS_B CHR
WHERE l.contract_id = cp_chr_id
AND NVL (l.amount_due_remaining, 0) <> 0
AND CHR.ID = l.contract_id
AND CHR.CUST_ACCT_ID = l.IXX_ID
GROUP BY l.contract_line_id,
l.stream_type_id;
SELECT l.contract_line_id contract_line_id,
l.stream_type_id stream_type_id,
SUM (l.amount_due_remaining) amount_due
FROM okl_bpd_ar_inv_lines_v l --ansethur 01-MAR-2007 Added for R12 B Billing Architecture
-- FROM okl_bpd_leasing_payment_trx_v l --ansethur 01-MAR-2007 commented for R12 B Billing Architecture
WHERE l.CONTRACT_ID = cp_chr_id
AND l.contract_line_id = cp_cle_id
AND NVL (l.amount_due_remaining, 0) <> 0
GROUP BY l.contract_line_id,l.stream_type_id;
SELECT l.contract_line_id contract_line_id,
l.stream_type_id stream_type_id,
SUM (l.amount_due_remaining) amount_due
FROM okl_bpd_ar_inv_lines_v l --ansethur 01-MAR-2007 Added for R12 B Billing Architecture
, OKC_K_HEADERS_B CHR
WHERE l.contract_id = cp_chr_id
AND l.contract_line_id = cp_cle_id
AND NVL (l.amount_due_remaining, 0) <> 0
AND CHR.ID = l.contract_id
AND CHR.CUST_ACCT_ID = l.IXX_ID
GROUP BY l.contract_line_id,
l.stream_type_id;
SELECT l.contract_line_id contract_line_id,
l.stream_type_id stream_type_id,
SUM (l.amount_due_remaining) amount_due
FROM okc_k_items i,
okl_bpd_ar_inv_lines_v l --ansethur 01-MAR-2007 Added for R12 B Billing Architecture
-- okl_bpd_leasing_payment_trx_v l --ansethur 01-MAR-2007 commented for R12 B Billing Architecture
WHERE i.object1_id1 = cp_cle_id
AND l.CONTRACT_ID = cp_chr_id
AND l.contract_line_id = i.cle_id
AND NVL (l.amount_due_remaining, 0) <> 0
GROUP BY l.contract_line_id,l.stream_type_id;
SELECT l.contract_line_id contract_line_id,
l.stream_type_id stream_type_id,
SUM (l.amount_due_remaining) amount_due
FROM okc_k_items i,
okl_bpd_ar_inv_lines_v l --ansethur 01-MAR-2007 Added for R12 B Billing Architecture
, OKC_K_HEADERS_B CHR
WHERE i.object1_id1 = cp_cle_id
AND l.contract_id = cp_chr_id
AND l.contract_line_id = i.cle_id
AND NVL (l.amount_due_remaining, 0) <> 0
AND CHR.ID = l.contract_id
AND CHR.CUST_ACCT_ID = l.IXX_ID
GROUP BY l.contract_line_id,
l.stream_type_id;