The following lines contain the word 'select', 'insert', 'update' or 'delete':
''UPDATE gcs_historical_rates ghr'' || g_nl ||
''SET (translated_rate, translated_amount, rate_type_code, '' ||
''last_update_date, last_updated_by, last_update_login) ='' || g_nl ||
'' (SELECT ghr1.translated_rate, ghr1.translated_amount, ''''P'''', '' ||
''sysdate, '' || gcs_translation_pkg.g_fnd_user_id || '', '' ||
gcs_translation_pkg.g_fnd_login_id || g_nl ||
'' FROM gcs_historical_rates ghr1'' || g_nl ||
'' WHERE ghr1.entity_id = ghr.entity_id'' || g_nl ||
'' AND ghr1.hierarchy_id = ghr.hierarchy_id'' || g_nl ||
'' AND ghr1.from_currency = ghr.from_currency'' || g_nl ||
'' AND ghr1.to_currency = ghr.to_currency'' || g_nl ||
'' AND ghr1.line_item_id = ghr.line_item_id'' || g_nl ||
'' AND ghr1.standard_re_rate_flag IS NULL '' || g_nl ||';
'' SELECT ghr3.rowid'' || g_nl ||
'' FROM GCS_HISTORICAL_RATES ghr2, '' || g_nl ||
'' GCS_HISTORICAL_RATES ghr3'' || g_nl ||
'' WHERE ghr2.entity_id = '' || p_entity_id || g_nl ||
'' AND ghr2.hierarchy_id = '' || p_hierarchy_id || g_nl ||
'' AND ghr2.from_currency = '''''' || p_from_ccy || '''''''' || g_nl ||
'' AND ghr2.to_currency = '''''' || p_to_ccy || '''''''' || g_nl ||
'' AND ghr2.rate_type_code in (''''H'''',''''P'''',''''C'''')'' || g_nl ||
'' AND ghr2.account_type_code IN (''''ASSET'''',''''LIABILITY'''',decode('''''' || p_eq_xlate_mode || '''''', ''''YTD'''', ''''EQUITY'''', NULL))'' || g_nl ||
'' AND ghr2.stop_rollforward_flag = ''''N'''''' || g_nl ||
'' AND ghr3.entity_id = ghr2.entity_id'' || g_nl ||
'' AND ghr3.hierarchy_id = ghr2.hierarchy_id'' || g_nl ||
'' AND ghr2.cal_period_id = '' || p_prev_period_id || g_nl ||
'' AND ghr3.cal_period_id = '' || p_cal_period_id || g_nl ||
'' AND ghr3.line_item_id = ghr2.line_item_id'' || g_nl ||
'' AND ghr3.standard_re_rate_flag IS NULL'' || g_nl ||';
UPDATE gcs_historical_rates ghr
SET (translated_rate, translated_amount, rate_type_code,
last_update_date, last_updated_by, last_update_login) =
(SELECT ghr1.translated_rate, ghr1.translated_amount, ''P'', sysdate,
gcs_translation_pkg.g_fnd_user_id, gcs_translation_pkg.g_fnd_login_id
FROM gcs_historical_rates ghr1
WHERE ghr1.entity_id = ghr.entity_id
AND ghr1.hierarchy_id = ghr.hierarchy_id
AND ghr1.from_currency = ghr.from_currency
AND ghr1.to_currency = ghr.to_currency
AND ghr1.line_item_id = ghr.line_item_id
AND ghr1.standard_re_rate_flag IS NULL';
SELECT ghr3.rowid
FROM GCS_HISTORICAL_RATES ghr2,
GCS_HISTORICAL_RATES ghr3
WHERE ghr2.entity_id = p_entity_id
AND ghr2.hierarchy_id = p_hierarchy_id
AND ghr2.from_currency = p_from_ccy
AND ghr2.to_currency = p_to_ccy
AND ghr2.rate_type_code in (''H'',''P'',''C'')
AND ghr2.account_type_code IN (''ASSET'',''LIABILITY'',decode(p_eq_xlate_mode, ''YTD'', ''EQUITY'', NULL))
AND ghr2.stop_rollforward_flag = ''N''
AND ghr3.entity_id = ghr2.entity_id
AND ghr3.hierarchy_id = ghr2.hierarchy_id
AND ghr2.cal_period_id = p_prev_period_id
AND ghr3.cal_period_id = p_cal_period_id
AND ghr3.line_item_id = ghr2.line_item_id
AND ghr3.standard_re_rate_flag IS NULL';
''DELETE FROM gcs_historical_rates ghr'' || g_nl ||
''WHERE (rowid, ''''E'''') IN ('' || g_nl ||
'' SELECT ghr3.rowid, nvl(ghr2.rate_type_code, ''''E'''')'' || g_nl ||
'' FROM GCS_HISTORICAL_RATES ghr3, '' || g_nl ||
'' GCS_HISTORICAL_RATES ghr2'' || g_nl ||
'' WHERE ghr3.entity_id = '' || p_entity_id || g_nl ||
'' AND ghr3.hierarchy_id = '' || p_hierarchy_id || g_nl ||
'' AND ghr3.rate_type_code = ''''P'''''' || g_nl ||
'' AND ghr3.account_type_code IN (''''ASSET'''',''''LIABILITY'''',decode('''''' || p_eq_xlate_mode || '''''', ''''YTD'''', ''''EQUITY'''', NULL))'' || g_nl ||
'' AND ghr3.cal_period_id = '' || p_cal_period_id || g_nl ||
'' AND ghr3.from_currency = '''''' || p_from_ccy || '''''''' || g_nl ||
'' AND ghr3.to_currency = '''''' || p_to_ccy || '''''''' || g_nl ||
'' AND ghr2.cal_period_id (+)= '' || p_prev_period_id || g_nl ||
'' AND ghr2.entity_id (+)= '' || p_entity_id || g_nl ||
'' AND ghr2.hierarchy_id (+)= '' || p_hierarchy_id || g_nl ||
'' AND ghr2.from_currency (+)= '''''' || p_from_ccy || '''''''' || g_nl ||
'' AND ghr2.to_currency (+)= '''''' || p_to_ccy || '''''''' || g_nl ||
'' AND ghr2.stop_rollforward_flag (+)= ''''N'''''' || g_nl ||
'' AND ghr2.line_item_id (+)= ghr3.line_item_id'' || g_nl ||
'' AND ghr3.standard_re_rate_flag IS NULL '' || g_nl ||';
DELETE FROM gcs_historical_rates ghr
WHERE (rowid, ''E'') IN (
SELECT ghr3.rowid, nvl(ghr2.rate_type_code, ''E'')
FROM GCS_HISTORICAL_RATES ghr3,
GCS_HISTORICAL_RATES ghr2
WHERE ghr3.entity_id = p_entity_id
AND ghr3.hierarchy_id = p_hierarchy_id
AND ghr3.rate_type_code = ''P''
AND ghr3.account_type_code IN (''ASSET'',''LIABILITY'',decode(p_eq_xlate_mode, ''YTD'', ''EQUITY'', NULL))
AND ghr3.cal_period_id = p_cal_period_id
AND ghr3.from_currency = p_from_ccy
AND ghr3.to_currency = p_to_ccy
AND ghr2.cal_period_id (+)= p_prev_period_id
AND ghr2.entity_id (+)= p_entity_id
AND ghr2.hierarchy_id (+)= p_hierarchy_id
AND ghr2.from_currency (+)= p_from_ccy
AND ghr2.to_currency (+)= p_to_ccy
AND ghr2.stop_rollforward_flag (+)= ''N''
AND ghr2.line_item_id (+)= ghr3.line_item_id
AND ghr3.standard_re_rate_flag IS NULL';
''INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(entity_id, hierarchy_id, '' ||
''cal_period_id, from_currency, to_currency, line_item_id, '' ||
''company_cost_center_org_id, intercompany_id, financial_elem_id, '' ||
''product_id, natural_account_id, channel_id, project_id, customer_id, task_id, '' ||
''user_dim1_id, user_dim2_id, user_dim3_id, user_dim4_id, user_dim5_id, '' ||
''user_dim6_id, user_dim7_id, user_dim8_id, user_dim9_id, user_dim10_id, '' ||
''translated_rate, translated_amount, rate_type_code, update_flag, '' ||
''account_type_code, stop_rollforward_flag, last_update_date, last_updated_by, '' ||
''last_update_login, creation_date, created_by)'' || g_nl ||
''SELECT '' || g_nl ||
''ghr.entity_id, ghr.hierarchy_id, '' || p_cal_period_id || '', ''||
''ghr.from_currency, ghr.to_currency, ghr.line_item_id, '' ||';
'' SELECT 1 FROM gcs_historical_rates ghr1'' || g_nl ||
'' WHERE ghr1.entity_id = p_entity_id'' || g_nl ||
'' AND ghr1.hierarchy_id = p_hierarchy_id'' || g_nl ||
'' AND ghr1.cal_period_id = p_cal_period_id'' || g_nl ||
'' AND ghr1.line_item_id = ghr.line_item_id'' || g_nl ||';
''' AND ghr1.update_flag = ''''N'''''' || g_nl ||
'' AND ghr1.from_currency = ghr.from_currency'' || g_nl ||
'' AND ghr1.to_currency = ghr.to_currency);'' || g_nl );
INSERT /*+ parallel (gcs_historical_rates) */ INTO gcs_historical_rates(
entity_id, hierarchy_id, cal_period_id, from_currency,
to_currency, line_item_id, company_cost_center_org_id, intercompany_id,
financial_elem_id, product_id, natural_account_id,
channel_id, project_id, customer_id, task_id, user_dim1_id, user_dim2_id,
user_dim3_id, user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id,
user_dim8_id, user_dim9_id, user_dim10_id, translated_rate,
translated_amount, rate_type_code, update_flag, account_type_code,
stop_rollforward_flag, last_update_date, last_updated_by,
last_update_login, creation_date, created_by)
SELECT
ghr.entity_id, ghr.hierarchy_id,
p_cal_period_id, ghr.from_currency, ghr.to_currency,
ghr.line_item_id,';
SELECT 1 FROM gcs_historical_rates ghr1
WHERE ghr1.entity_id = p_entity_id
AND ghr1.hierarchy_id = p_hierarchy_id
AND ghr1.cal_period_id = p_cal_period_id
AND ghr1.line_item_id = ghr.line_item_id';
' AND ghr1.update_flag = ''N''
AND ghr1.from_currency = ghr.from_currency
AND ghr1.to_currency = ghr.to_currency);
''INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(translate_rule_code, account_type_code, '' ||
''line_item_id, company_cost_center_org_id, intercompany_id, financial_elem_id, '' ||
''product_id, natural_account_id, channel_id, '' ||
''project_id, customer_id, task_id, user_dim1_id, user_dim2_id, user_dim3_id, '' ||
''user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id, user_dim8_id, '' ||
''user_dim9_id, user_dim10_id, t_amount_dr, t_amount_cr, begin_ytd_dr, '' ||
''begin_ytd_cr, xlate_ptd_dr, xlate_ptd_cr, xlate_ytd_dr, xlate_ytd_cr)'' || g_nl ||
''SELECT'' || g_nl ||
''decode(fxata.dim_attribute_varchar_member,'' || g_nl ||
'' ''''REVENUE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EXPENSE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EQUITY'''', '''''' || p_eq_xlate_mode || '''''','' || g_nl ||
'' ''''YTD''''),'' || g_nl ||
''fxata.dim_attribute_varchar_member, fb.line_item_id, '' ||';
''FROM (SELECT'' || g_nl ||
'' fb_in.line_item_id,'' || g_nl ||';
''AND ghr.update_flag (+) = ''''N'''' '' || g_nl ||';
INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(
translate_rule_code, account_type_code, line_item_id,
company_cost_center_org_id, intercompany_id, financial_elem_id,
product_id, natural_account_id, channel_id, project_id,
customer_id, task_id, user_dim1_id, user_dim2_id, user_dim3_id,
user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id, user_dim8_id,
user_dim9_id, user_dim10_id, t_amount_dr, t_amount_cr, begin_ytd_dr,
begin_ytd_cr, xlate_ptd_dr, xlate_ptd_cr, xlate_ytd_dr, xlate_ytd_cr)
SELECT /*+ ordered */
decode(fxata.dim_attribute_varchar_member,
''REVENUE'', p_is_xlate_mode,
''EXPENSE'', p_is_xlate_mode,
''EQUITY'', p_eq_xlate_mode,
''YTD''),
fxata.dim_attribute_varchar_member, fb.line_item_id,';
FROM (SELECT
fb_in.line_item_id,';
AND ghr.update_flag (+) = ''N''';
AND NOT EXISTS (SELECT ''X''
FROM gcs_historical_rates ghr_retained
WHERE ghr_retained.standard_re_rate_flag = ''Y''
AND ghr_retained.hierarchy_id = p_hierarchy_id
AND ghr_retained.entity_id = p_entity_id
AND ghr_retained.cal_period_id = p_cal_period_id
AND ghr_retained.line_item_id = fb.line_item_id';
''INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(translate_rule_code, account_type_code, '' ||
''line_item_id, company_cost_center_org_id, intercompany_id, financial_elem_id, '' ||
''product_id, natural_account_id, channel_id, '' ||
''project_id, customer_id, task_id, user_dim1_id, user_dim2_id, user_dim3_id, '' ||
''user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id, user_dim8_id, '' ||
''user_dim9_id, user_dim10_id, t_amount_dr, t_amount_cr, begin_ytd_dr, '' ||
''begin_ytd_cr, xlate_ptd_dr, xlate_ptd_cr, xlate_ytd_dr, xlate_ytd_cr)'' || g_nl ||
''SELECT'' || g_nl ||
''decode(fxata.dim_attribute_varchar_member,'' || g_nl ||
'' ''''REVENUE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EXPENSE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EQUITY'''', '''''' || p_eq_xlate_mode || '''''','' || g_nl ||
'' ''''YTD''''),'' || g_nl ||
''fxata.dim_attribute_varchar_member, fb.line_item_id, '' ||';
''FROM (SELECT'' || g_nl ||
'' fb_in.line_item_id,'' || g_nl ||';
''AND ghr.update_flag (+) = ''''N'''' '' || g_nl ||';
INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(
translate_rule_code, account_type_code, line_item_id,
company_cost_center_org_id, intercompany_id, financial_elem_id,
product_id, natural_account_id, channel_id, project_id,
customer_id, task_id, user_dim1_id, user_dim2_id, user_dim3_id,
user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id, user_dim8_id,
user_dim9_id, user_dim10_id, t_amount_dr, t_amount_cr, begin_ytd_dr,
begin_ytd_cr, xlate_ptd_dr, xlate_ptd_cr, xlate_ytd_dr, xlate_ytd_cr)
SELECT /*+ ordered */
decode(fxata.dim_attribute_varchar_member,
''REVENUE'', p_is_xlate_mode,
''EXPENSE'', p_is_xlate_mode,
''EQUITY'', p_eq_xlate_mode,
''YTD''),
fxata.dim_attribute_varchar_member, fb.line_item_id,';
FROM (SELECT
fb_in.line_item_id,';
AND ghr.update_flag (+) = ''N''';
AND NOT EXISTS (SELECT ''X''
FROM gcs_historical_rates ghr_retained
WHERE ghr_retained.standard_re_rate_flag = ''Y''
AND ghr_retained.hierarchy_id = p_hierarchy_id
AND ghr_retained.entity_id = p_entity_id
AND ghr_retained.cal_period_id = p_cal_period_id
AND ghr_retained.line_item_id = fb.line_item_id';
SELECT cb.associated_object_id
FROM gcs_categories_b cb
WHERE cb.category_code = ''TRANSLATION'';
''INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(translate_rule_code, account_type_code, '' ||
''line_item_id, company_cost_center_org_id, '' ||
''intercompany_id, financial_elem_id, product_id, '' ||
''natural_account_id, channel_id, project_id, customer_id, task_id, '' ||
''user_dim1_id, user_dim2_id, user_dim3_id, user_dim4_id, user_dim5_id, '' ||
''user_dim6_id, user_dim7_id, user_dim8_id, user_dim9_id, user_dim10_id, '' ||
''t_amount_dr, t_amount_cr, begin_ytd_dr, begin_ytd_cr, xlate_ptd_dr, '' ||
''xlate_ptd_cr, xlate_ytd_dr,xlate_ytd_cr)'' || g_nl ||
''SELECT'' || g_nl ||
''decode(fxata.dim_attribute_varchar_member,'' || g_nl ||
'' ''''REVENUE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EXPENSE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EQUITY'''', '''''' || p_eq_xlate_mode || '''''','' || g_nl ||
'' ''''YTD''''),'' || g_nl ||
''fxata.dim_attribute_varchar_member, fb.line_item_id, '' ||';
''FROM (SELECT'' || g_nl ||
'' fb_in.line_item_id,'' || g_nl ||';
''AND ghr.update_flag (+)= ''''N'''''' || g_nl ||';
INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(
translate_rule_code, account_type_code, line_item_id,
company_cost_center_org_id, intercompany_id, financial_elem_id,
product_id, natural_account_id, channel_id, project_id,
customer_id, task_id, user_dim1_id, user_dim2_id, user_dim3_id,
user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id, user_dim8_id,
user_dim9_id, user_dim10_id, t_amount_dr, t_amount_cr, begin_ytd_dr,
begin_ytd_cr, xlate_ptd_dr, xlate_ptd_cr, xlate_ytd_dr,xlate_ytd_cr)
SELECT
decode(fxata.dim_attribute_varchar_member,
''REVENUE'', p_is_xlate_mode,
''EXPENSE'', p_is_xlate_mode,
''EQUITY'', p_eq_xlate_mode,
''YTD''),
fxata.dim_attribute_varchar_member, fb.line_item_id,';
FROM (SELECT
fb_in.line_item_id,';
AND ghr.update_flag (+)= ''N''';
AND NOT EXISTS (SELECT ''X''
FROM gcs_historical_rates ghr_retained
WHERE ghr_retained.standard_re_rate_flag = ''Y''
AND ghr_retained.hierarchy_id = p_hierarchy_id
AND ghr_retained.entity_id = p_entity_id
AND ghr_retained.cal_period_id = p_cal_period_id
AND ghr_retained.line_item_id = fb.line_item_id';
''INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(translate_rule_code, account_type_code, '' ||
''line_item_id, company_cost_center_org_id, '' ||
''intercompany_id, financial_elem_id, product_id, '' ||
''natural_account_id, channel_id, project_id, customer_id, task_id, '' ||
''user_dim1_id, user_dim2_id, user_dim3_id, user_dim4_id, user_dim5_id, '' ||
''user_dim6_id, user_dim7_id, user_dim8_id, user_dim9_id, user_dim10_id, '' ||
''t_amount_dr, t_amount_cr, begin_ytd_dr, begin_ytd_cr, xlate_ptd_dr, '' ||
''xlate_ptd_cr, xlate_ytd_dr,xlate_ytd_cr)'' || g_nl ||
''SELECT'' || g_nl ||
''decode(fxata.dim_attribute_varchar_member,'' || g_nl ||
'' ''''REVENUE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EXPENSE'''', '''''' || p_is_xlate_mode || '''''','' || g_nl ||
'' ''''EQUITY'''', '''''' || p_eq_xlate_mode || '''''','' || g_nl ||
'' ''''YTD''''),'' || g_nl ||
''fxata.dim_attribute_varchar_member, fb.line_item_id, '' ||';
''FROM (SELECT'' || g_nl ||
'' fb_in.line_item_id,'' || g_nl ||';
''AND ghr.update_flag (+)= ''''N'''''' || g_nl ||';
INSERT /*+ parallel (GCS_TRANSLATION_GT) */ INTO GCS_TRANSLATION_GT(
translate_rule_code, account_type_code, line_item_id,
company_cost_center_org_id, intercompany_id, financial_elem_id,
product_id, natural_account_id, channel_id, project_id,
customer_id, task_id, user_dim1_id, user_dim2_id, user_dim3_id,
user_dim4_id, user_dim5_id, user_dim6_id, user_dim7_id, user_dim8_id,
user_dim9_id, user_dim10_id, t_amount_dr, t_amount_cr, begin_ytd_dr,
begin_ytd_cr, xlate_ptd_dr, xlate_ptd_cr, xlate_ytd_dr,xlate_ytd_cr)
SELECT
decode(fxata.dim_attribute_varchar_member,
''REVENUE'', p_is_xlate_mode,
''EXPENSE'', p_is_xlate_mode,
''EQUITY'', p_eq_xlate_mode,
''YTD''),
fxata.dim_attribute_varchar_member, fb.line_item_id,';
FROM (SELECT
fb_in.line_item_id,';
AND ghr.update_flag (+)= ''N''';
AND NOT EXISTS (SELECT ''X''
FROM gcs_historical_rates ghr_retained
WHERE ghr_retained.standard_re_rate_flag = ''Y''
AND ghr_retained.hierarchy_id = p_hierarchy_id
AND ghr_retained.entity_id = p_entity_id
AND ghr_retained.cal_period_id = p_cal_period_id
AND ghr_retained.line_item_id = fb.line_item_id';