The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT lkup.lookup_code
FROM fnd_lookups lkup
WHERE lkup.lookup_type = p_lookup_type
AND lkup.lookup_code = p_lookup_code
;
SELECT rowid
FROM oki_perf_measures okv
WHERE okv.period_set_name = p_period_set_name
AND okv.period_name = p_period_name
AND okv.authoring_org_id = p_authoring_org_id
AND okv.kpi_code = p_kpi_code
AND okv.scs_code = p_scs_code
;
SELECT oki_perf_measures_s1.nextval seq
FROM dual
;
INSERT INTO oki_perf_measures
( id
, period_set_name
, period_name
, period_type
, authoring_org_id
, authoring_org_name
, kpi_code
, kpi_value
, scs_code
, 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_kpi_code
, p_kpi_value
, p_scs_code
, oki_load_okv_pvt.g_request_id
, oki_load_okv_pvt.g_program_application_id
, oki_load_okv_pvt.g_program_id
, oki_load_okv_pvt.g_program_update_date ) ;
UPDATE oki_perf_measures SET
kpi_value = p_kpi_value
, request_id = oki_load_okv_pvt.g_request_id
, program_application_id = oki_load_okv_pvt.g_program_application_id
, program_id = oki_load_okv_pvt.g_program_id
, program_update_date = oki_load_okv_pvt.g_program_update_date
WHERE ROWID = p_okv_rowid ;
SELECT DISTINCT shd.authoring_org_id org_id
, /*11510 change*/ NULL organization_name
, shd.scs_code
FROM oki_sales_k_hdrs shd
;
SELECT ROUND(NVL(SUM(TRUNC(p_summary_build_date ) - TRUNC(shd.creation_date)), 0)
/ DECODE(COUNT(shd.chr_id), NULL, 1, 0, 1, COUNT(shd.chr_id)), 2) dro_value
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code = 'ENTERED'
AND shd.is_new_yn IS NULL
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
;
SELECT NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('SIGNED', 'ACTIVE')
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.close_date BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.date_signed BETWEEN p_glpr_start_date AND p_glpr_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 NVL(SUM(shd.base_forecast_amount), 0) base_forecast_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('SIGNED', 'ACTIVE', 'ENTERED')
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.close_date BETWEEN p_glpr_start_date AND p_glpr_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 /*11510 changes removed NVL(SUM(cle.price_negotiated * odr.conversion_rate), 0) */ SUM(shd.base_contract_amount) base_price_negotiated
FROM
/* 11510 changes removed okc_k_lines_b cle */
oki_sales_k_hdrs shd
, okc_operation_lines ole
, okc_operation_instances oie
, okc_class_operations cop
/*,11510 changes removed oki_daily_rates odr */
-- Join lines to head to get currency code from header
-- and convert the currency in base
WHERE
/*11510 changes comment out the following joins
shd.chr_id = cle.dnz_chr_id
AND odr.to_currency = oki_load_okv_pvt.g_base_currency
AND odr.from_currency = nvl(cle.currency_code, shd.currency_code) */
-- Get all consolidated contracts
cop.opn_code = 'REN_CON'
AND ole.process_flag = 'P'
-- Get all signed and active or contracts
AND shd.ste_code IN ('SIGNED', 'ACTIVE')
-- Get priced lines
/*11510 changes removed the condition AND cle.price_level_ind = 'Y' */
-- Go from okc_k_lines_b to okc_class_operations
AND shd.chr_id = ole.subject_chr_id
AND ole.oie_id = oie.id
AND oie.cop_id = cop.id
AND shd.date_signed BETWEEN p_glpr_start_date AND p_glpr_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
;
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 := '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 ROUND(NVL(SUM(TRUNC(p_summary_build_date ) - TRUNC(shd.creation_date)), 0)
/ DECODE(COUNT(shd.chr_id), NULL, 1, 0, 1, COUNT(shd.chr_id)), 2) dro_value
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code = 'ENTERED'
AND shd.is_new_yn IS NULL
AND shd.scs_code = p_scs_code
;
SELECT NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('SIGNED', 'ACTIVE')
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.close_date BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.date_signed BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.is_new_yn IS NULL
AND shd.scs_code = p_scs_code
;
SELECT NVL(SUM(shd.base_forecast_amount), 0) base_forecast_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('SIGNED', 'ACTIVE', 'ENTERED')
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.close_date BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.is_new_yn IS NULL
AND shd.scs_code = p_scs_code
;
SELECT /*11510 changes removed NVL(SUM(cle.price_negotiated * odr.conversion_rate), 0) */ SUM(shd.base_contract_amount) base_price_negotiated
/* 11510 changes removed okc_k_lines_b cle */
FROM
oki_sales_k_hdrs shd
, okc_operation_lines ole
, okc_operation_instances oie
, okc_class_operations cop
/*,11510 changes removed oki_daily_rates odr */
-- Join lines to head to get currency code from header
-- and convert the currency in base
WHERE
/*11510 changes removed the following joins
shd.chr_id = cle.dnz_chr_id
AND odr.to_currency = oki_load_okv_pvt.g_base_currency
AND odr.from_currency = nvl(cle.currency_code, shd.currency_code) */
-- Get all consolidated contracts
cop.opn_code = 'REN_CON'
AND ole.process_flag = 'P'
-- Get all signed and active or contracts
AND shd.ste_code IN ('SIGNED', 'ACTIVE')
AND shd.chr_id = ole.subject_chr_id
AND ole.oie_id = oie.id
AND oie.cop_id = cop.id
AND shd.date_signed BETWEEN p_glpr_start_date AND p_glpr_end_date
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 := '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 ROUND(NVL(SUM(TRUNC(p_summary_build_date ) - TRUNC(shd.creation_date)), 0)
/ DECODE(COUNT(shd.chr_id), NULL, 1, 0, 1, COUNT(shd.chr_id)), 2) dro_value
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code = 'ENTERED'
AND shd.is_new_yn IS NULL
;
SELECT NVL(SUM(shd.base_contract_amount), 0) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('SIGNED', 'ACTIVE')
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.close_date BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.date_signed BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.is_new_yn IS NULL
;
SELECT NVL(SUM(shd.base_forecast_amount), 0) base_forecast_amount
FROM oki_sales_k_hdrs shd
WHERE shd.ste_code IN ('SIGNED', 'ACTIVE', 'ENTERED')
AND shd.win_percent IS NOT NULL
AND shd.close_date IS NOT NULL
AND shd.close_date BETWEEN p_glpr_start_date AND p_glpr_end_date
AND shd.is_new_yn IS NULL
;
SELECT /*11510 changes removed NVL(SUM(cle.price_negotiated * odr.conversion_rate), 0) */
SUM(shd.base_contract_amount) base_price_negotiated
/* 11510 changes removed okc_k_lines_b cle */
FROM
oki_sales_k_hdrs shd
, okc_operation_lines ole
, okc_operation_instances oie
, okc_class_operations cop
/*11510 changes removed oki_daily_rates odr */
WHERE
/*11510 changes removed the following joins
shd.chr_id = cle.dnz_chr_id
AND odr.to_currency = oki_load_okv_pvt.g_base_currency
AND odr.from_currency = nvl(cle.currency_code, shd.currency_code) */
-- Get all consolidated contracts
cop.opn_code = 'REN_CON'
AND ole.process_flag = 'P'
-- Get all signed and active or contracts
AND shd.ste_code IN ('SIGNED', 'ACTIVE')
AND shd.chr_id = ole.subject_chr_id
AND ole.oie_id = oie.id
AND oie.cop_id = cop.id
AND shd.date_signed BETWEEN p_glpr_start_date AND p_glpr_end_date
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 := '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 ;