The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT rowid
FROM oki_yoy_renewal_amt yyr
WHERE yyr.period_set_name = p_period_set_name
AND yyr.period_name = p_period_name
AND yyr.authoring_org_id = p_authoring_org_id
AND yyr.year = p_year
AND yyr.month = p_month
AND yyr.scs_code = p_scs_code
;
SELECT oki_yoy_renewal_amt_s1.nextval seq
FROM dual
;
INSERT INTO oki_yoy_renewal_amt
( id
, period_set_name
, period_name
, period_type
, authoring_org_id
, authoring_org_name
, year
, month
, scs_code
, base_contract_amount
, 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_year
, p_month
, p_scs_code
, p_base_contract_amount
, oki_load_yra_pvt.g_request_id
, oki_load_yra_pvt.g_program_application_id
, oki_load_yra_pvt.g_program_id
, oki_load_yra_pvt.g_program_update_date ) ;
UPDATE oki_yoy_renewal_amt SET
base_contract_amount = p_base_contract_amount
, request_id = oki_load_yra_pvt.g_request_id
, program_application_id = oki_load_yra_pvt.g_program_application_id
, program_id = oki_load_yra_pvt.g_program_id
, program_update_date = oki_load_yra_pvt.g_program_update_date
WHERE ROWID = p_yra_rowid ;
SELECT DISTINCT shd.authoring_org_id authoring_org_id
, /*11510 change*/ NULL organization_name
, shd.scs_code
FROM oki_sales_k_hdrs shd
;
SELECT TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'RRRR') year
, TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'FMMM') Month
, SUM(shd.base_contract_amount ) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE LEAST(NVL(shd.date_signed, shd.start_date), shd.start_date)
BETWEEN ADD_MONTHS((last_day(p_glpr_start_date) + 1), -24)
AND last_day(p_glpr_end_date)
AND shd.is_new_yn IS NULL
AND shd.date_signed IS NOT NULL
AND shd.authoring_org_id = p_authoring_org_id
AND shd.scs_code = p_scs_code
GROUP BY TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'RRRR')
, TO_CHAR(least(nvl(shd.date_signed, shd.start_date),
shd.start_date), 'FMMM')
;
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 TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'RRRR') year
, TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'FMMM') Month
, SUM(shd.base_contract_amount ) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE LEAST(NVL(shd.date_signed, shd.start_date), shd.start_date)
BETWEEN ADD_MONTHS((last_day(p_glpr_start_date) + 1), -24)
AND last_day(p_glpr_end_date)
AND shd.is_new_yn IS NULL
AND shd.date_signed IS NOT NULL
AND shd.scs_code = p_scs_code
GROUP BY TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'RRRR')
, TO_CHAR(least(nvl(shd.date_signed, shd.start_date),
shd.start_date), 'FMMM')
;
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 TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'RRRR') year
, TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'FMMM') Month
, SUM(shd.base_contract_amount ) base_contract_amount
FROM oki_sales_k_hdrs shd
WHERE LEAST(NVL(shd.date_signed, shd.start_date), shd.start_date)
BETWEEN ADD_MONTHS((last_day(p_glpr_start_date) + 1), -24)
AND last_day(p_glpr_end_date)
AND shd.is_new_yn IS NULL
AND shd.date_signed IS NOT NULL
GROUP BY TO_CHAR(LEAST(NVL(shd.date_signed, shd.start_date),
shd.start_date), 'RRRR')
, TO_CHAR(least(nvl(shd.date_signed, shd.start_date),
shd.start_date), 'FMMM')
;
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 ;