The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT rowid
FROM oki_renew_by_statuses rbs
WHERE rbs.period_set_name = p_period_set_name
AND rbs.period_name = p_period_name
AND rbs.authoring_org_id = p_authoring_org_id
AND rbs.status_code = p_status_code
AND rbs.scs_code = p_scs_code
;
SELECT oki_renew_by_statuses_s1.nextval seq
FROM dual ;
INSERT INTO oki_renew_by_statuses
( id
, period_set_name
, period_name
, period_type
, authoring_org_id
, authoring_org_name
, status_code
, scs_code
, base_amount
, contract_count
, request_id
, program_application_id
, program_id
, program_update_date )
VALUES ( l_sequence
, p_period_set_name
, p_period_name
, p_period_type
, p_authoring_org_id
, p_authoring_org_name
, p_status_code
, p_scs_code
, p_base_amount
, p_contract_count
, oki_load_rbs_pvt.g_request_id
, oki_load_rbs_pvt.g_program_application_id
, oki_load_rbs_pvt.g_program_id
, oki_load_rbs_pvt.g_program_update_date ) ;
UPDATE oki_renew_by_statuses SET
base_amount = p_base_amount
, contract_count = p_contract_count
, request_id = oki_load_rbs_pvt.g_request_id
, program_application_id = oki_load_rbs_pvt.g_program_application_id
, program_id = oki_load_rbs_pvt.g_program_id
, program_update_date = oki_load_rbs_pvt.g_program_update_date
WHERE ROWID = p_rowid ;
SELECT DISTINCT shd.authoring_org_id authoring_org_id
, /*11510 change*/ NULL authoring_org_name
, shd.scs_code scs_code
FROM oki_sales_k_hdrs shd
;
SELECT COUNT(DISTINCT(shd.chr_id)) contract_count
FROM /*11510 change removed oki_Expired_lines and added oki_cov_prd_lines */
oki_cov_prd_lines cpl
, oki_sales_k_hdrs shd
WHERE cpl.end_date BETWEEN p_start_date AND p_end_date
/*11510 change start*/
AND cpl.is_exp_not_renewed_yn='Y'
/*11510 change end*/
AND cpl.chr_id = shd.chr_id
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
;
SELECT NVL(SUM(cpl.base_price_negotiated), 0) base_price_negotiated
/*11510 change removed oki_Expired_lines and added oki_cov_prd_lines */
FROM oki_cov_prd_lines cpl
, oki_sales_k_hdrs shd
WHERE cpl.end_date BETWEEN p_start_date AND p_end_date
/*11510 change start*/
AND cpl.is_exp_not_renewed_yn='Y'
/*11510 change end*/
AND cpl.chr_id = shd.chr_id
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
;
SELECT COUNT(*) contract_count
, NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code = 'ENTERED'
AND NVL(shd.close_date, shd.start_date)
BETWEEN p_start_date AND p_end_date
AND shd.is_new_yn IS NULL
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
;
SELECT COUNT(*) contract_count
, NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('ACTIVE','SIGNED')
AND LEAST(NVL(shd.date_signed, shd.start_date), shd.start_date)
BETWEEN p_start_date AND p_end_date
AND shd.is_new_yn IS NULL
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
;
SELECT COUNT(*) contract_count
, NVL(SUM(base_forecast_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.close_date BETWEEN p_start_date AND p_end_date
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.is_new_yn IS NULL
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
SELECT DISTINCT shd.scs_code
FROM oki_sales_k_hdrs shd
;
SELECT COUNT(DISTINCT(shd.chr_id)) contract_count
/*11510 change removed oki_Expired_lines and added oki_cov_prd_lines */
FROM oki_cov_prd_lines cpl
, oki_sales_k_hdrs shd
WHERE cpl.end_date BETWEEN p_start_date AND p_end_date
/*11510 change start*/
AND cpl.is_exp_not_renewed_yn='Y'
/*11510 change end*/
AND cpl.chr_id = shd.chr_id
AND shd.scs_code = p_scs_code
;
SELECT NVL(SUM(cpl.base_price_negotiated), 0) base_price_negotiated
/*11510 change removed oki_Expired_lines and added oki_cov_prd_lines */
FROM oki_cov_prd_lines cpl
, oki_sales_k_hdrs shd
WHERE cpl.end_date BETWEEN p_start_date AND p_end_date
/*11510 change start*/
AND cpl.is_exp_not_renewed_yn='Y'
/*11510 change end*/
AND cpl.chr_id = shd.chr_id
AND shd.scs_code = p_scs_code
;
SELECT COUNT(*) contract_count
, NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code = 'ENTERED'
AND NVL(shd.close_date, shd.start_date) BETWEEN p_start_date AND p_end_date
AND shd.is_new_yn IS NULL
AND shd.scs_code = p_scs_code
;
SELECT COUNT(*) contract_count
, NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('ACTIVE','SIGNED')
AND LEAST(NVL(shd.date_signed, shd.start_date), shd.start_date)
BETWEEN p_start_date AND p_end_date
AND shd.is_new_yn IS NULL
AND shd.scs_code = p_scs_code
;
SELECT COUNT(*) contract_count
, NVL(SUM(base_forecast_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.close_date BETWEEN p_start_date AND p_end_date
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.is_new_yn IS NULL
AND shd.scs_code = p_scs_code
;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
SELECT NVL(SUM(cpl.base_price_negotiated), 0) base_price_negotiated
/*11510 change removed oki_Expired_lines and added oki_cov_prd_lines */
FROM oki_cov_prd_lines cpl
WHERE cpl.end_date between p_start_date AND p_end_date
/*11510 change*/
AND cpl.is_exp_not_renewed_yn='Y' ;
SELECT COUNT(DISTINCT(shd.chr_id)) contract_count
/*11510 change removed oki_Expired_lines and added oki_cov_prd_lines */
FROM oki_cov_prd_lines cpl
, oki_sales_k_hdrs shd
WHERE cpl.end_date BETWEEN p_start_date and p_end_date
/*11510 change*/
AND cpl.is_exp_not_renewed_yn='Y'
AND cpl.chr_id = shd.chr_id ;
SELECT COUNT(*) contract_count
, NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code = 'ENTERED'
AND NVL(shd.close_date, shd.start_date)
BETWEEN p_start_date AND p_end_date
AND shd.is_new_yn IS NULL
;
SELECT count(*) contract_count
, NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('ACTIVE','SIGNED')
AND LEAST(NVL(shd.date_signed, shd.start_date), shd.start_date)
BETWEEN p_start_date AND p_end_date
AND shd.is_new_yn IS NULL
;
SELECT count(*) contract_count
, NVL(SUM(base_forecast_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.close_date BETWEEN p_start_date AND p_end_date
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.is_new_yn IS NULL
;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
l_loc := 'Opening cursor to determine if insert or update should occur.' ;
l_loc := 'Insert the new record.' ;
l_loc := 'Update the existing record.' ;
oki_refresh_pvt.update_oki_refresh( l_table_name, l_retcode ) ;
g_program_update_date := SYSDATE ;