The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE UPDATE_CACHE_STATS
(
err_buff OUT NOCOPY VARCHAR2,
retcode OUT NOCOPY NUMBER
)
IS
/*****************************************************************
Cursors for permanent full data objects
*****************************************************************/
CURSOR pattern_csr IS
SELECT count(*)
FROM qp_patterns;
SELECT count(*)
FROM qp_segments_b qps,
qp_prc_contexts_b qpc
WHERE qps.prc_context_id = qpc.prc_context_id;
SELECT count(*)
FROM qp_price_req_sources;
SELECT count(*)
FROM qp_pricing_phases qpp,
qp_event_phases qpe
WHERE qpe.pricing_phase_id = qpp.pricing_phase_id;
SELECT count(*)
FROM FND_PROFILE_OPTIONS o, FND_PROFILE_OPTION_VALUES ov
WHERE o.APPLICATION_ID = 661 and o.PROFILE_OPTION_ID = ov.PROFILE_OPTION_ID (+) and o.APP_ENABLED_FLAG = 'N' and o.RESP_ENABLED_FLAG = 'N' and o.USER_ENABLED_FLAG = 'N';
SELECT count(*)
FROM qp_cache_do_sizes;
SELECT count(*)
FROM qp_cache_stats;
SELECT count(*)
FROM qp_list_headers_b
WHERE active_flag = 'Y';
SELECT count(*)
FROM qp_qualifiers qpq, qp_list_headers_b qph1, qp_list_headers_b qph2
WHERE qualifier_context = 'MODLIST' and qualifier_attribute = 'QUALIFIER_ATTRIBUTE4'
and qph1.active_flag = 'Y' and qph2.active_flag = 'Y'
and qph1.list_header_id = qpq.list_header_id
and to_char(qph2.list_header_id) = qpq.qualifier_attr_value
and qph1.list_type_code = 'PRL';
SELECT count(*) FROM (
SELECT 1
FROM qp_attribute_groups qp, qp_list_headers_b qph
WHERE qp.list_line_id = -1 and qph.active_flag = 'Y' and qp.list_header_id(+) = qph.list_header_id UNION ALL
SELECT 1
FROM qp_list_headers_b qp
WHERE qp.active_flag = 'Y' and NOT EXISTS (SELECT * FROM qp_attribute_groups qpg WHERE qpg.list_line_id=-1 and qpg.list_header_id = qp.list_header_id));
SELECT count(*)
FROM (select /*+ ordered index(qph qp_list_headers_b_n7) use_nl(qpl) */
distinct qpl.pricing_phase_id, qpl.list_header_id, qph.currency_code
FROM qp_list_headers_b qph, qp_list_lines qpl
WHERE qph.active_flag = 'Y'
and qph.ask_for_flag <> 'Y'
and qph.list_header_id = qpl.list_header_id);
SELECT count(*)
FROM qp_pattern_phases qpph, qp_patterns qpp
WHERE qpp.pattern_type = 'HP' and qpp.pattern_id = qpph.pattern_id;
SELECT count(*)
FROM okx_units_of_measure_v;
SELECT count(*)
FROM okc_time_code_units_b
WHERE active_flag = 'Y';
SELECT count(*)
FROM qp_list_headers_b qph, qp_list_lines qpl
WHERE qpl.qualification_ind in (0, 2)
and qpl.list_header_id = qph.list_header_id
and qph.active_flag = 'Y';
SELECT count(*)
FROM mtl_uom_conversions
WHERE (disable_date is null or disable_date > sysdate)
and inventory_item_id = 0;
SELECT /*+ ordered use_nl(qpl) index(qph qp_list_headers_b_n7) */ count(DISTINCT
qpl.cache_key)
FROM qp_list_headers_b qph, qp_list_lines qpl
WHERE qph.active_flag = 'Y'
and qph.list_type_code not in ('PML', 'PRL', 'AGR')
and qpl.list_header_id = qph.list_header_id;
SELECT /*+ ordered use_nl(qpl) index(qph qp_list_headers_b_n7) */ count(DISTINCT
qpl.cache_key)
FROM qp_list_headers_b qph, qp_list_lines qpl
WHERE qph.active_flag = 'Y'
and qph.list_type_code = 'PRL'
and qpl.list_header_id = qph.list_header_id;
SELECT count(*)
FROM qp_price_formulas qpf;
SELECT count(*)
FROM qp_list_headers_b qlh
WHERE qlh.list_type_code = 'PML';
SELECT count(*)
FROM mtl_uom_conversions
WHERE (disable_date IS null or disable_date > sysdate)
and inventory_item_id <> 0;
SELECT count(DISTINCT qpc.currency_header_id)
FROM qp_currency_lists_b qpc, qp_list_headers_b qph
WHERE qph.active_flag = 'Y'
and qph.currency_code = qpc.base_currency_code;
SELECT /*+ ordered use_nl(qpl) index(qph qp_list_headers_b_n7) */ DISTINCT
qpl.cache_key
FROM qp_list_headers_b qph, qp_list_lines qpl
WHERE qph.active_flag = 'Y'
and qph.list_type_code not in ('PML', 'PRL', 'AGR')
and qpl.list_header_id = qph.list_header_id
and ROWNUM < 200;
SELECT /*+ ordered use_nl(qpl) index(qph qp_list_headers_b_n7) */ DISTINCT
qpl.cache_key
FROM qp_list_headers_b qph, qp_list_lines qpl
WHERE qph.active_flag = 'Y'
and qph.list_type_code = 'PRL'
and qpl.list_header_id = qph.list_header_id
and ROWNUM < 200;
SELECT
qpf.price_formula_id
FROM qp_price_formulas qpf
WHERE ROWNUM < 200;
SELECT
qlh.list_header_id
FROM qp_list_headers_b qlh
WHERE qlh.list_type_code = 'PML'
and ROWNUM < 200;
SELECT
inventory_item_id
FROM mtl_uom_conversions
WHERE (disable_date IS null or disable_date > sysdate)
and inventory_item_id <> 0
and ROWNUM < 200;
SELECT DISTINCT
qpc.currency_header_id
FROM qp_currency_lists_b qpc, qp_list_headers_b qph
WHERE qph.active_flag = 'Y'
and qph.currency_code = qpc.base_currency_code
and ROWNUM < 200;
SELECT sum(c) FROM (
SELECT /*+ ordered use_nl(qph, qpr) index(qph qp_list_headers_b_pk) index(qpa qp_pricing_attributes_n2) */ count(*) c
FROM qp_list_lines qpl, qp_list_headers_b qph, qp_pricing_attributes qpa
WHERE qph.active_flag = 'Y' and qpl.list_header_id = qph.list_header_id and qpl.cache_key = p_cache_key and qpl.list_line_id = qpa.list_line_id(+)
UNION ALL
SELECT /*+ ordered use_nl(qph, qpr) index(qph qp_list_headers_b_pk) index(qpa qp_pricing_attributes_n2) */ count(*) c
FROM qp_list_lines qpl2, qp_rltd_modifiers qpr, qp_list_lines qpl, qp_list_headers_b qph, qp_pricing_attributes qpa
WHERE qph.active_flag = 'Y' and qpl.list_header_id = qph.list_header_id and qpl2.cache_key = p_cache_key and qpl2.list_line_id = qpr.from_rltd_modifier_id and qpl.list_line_id = qpr.to_rltd_modifier_id and qpl.list_line_id = qpa.list_line_id(+)
);
SELECT sum(c) FROM (
SELECT count(*) c
FROM qp_attribute_groups qp, qp_list_headers_b qph
WHERE qp.pricing_phase_id <> -1 and qph.active_flag = 'Y' and qp.cache_key = p_cache_key and qp.list_header_id = qph.list_header_id
UNION ALL
SELECT /*+ ordered use_nl(qph) */ count(*) c
FROM qp_list_lines qp, qp_list_headers_b qph
WHERE qph.active_flag = 'Y' and qp.cache_key = p_cache_key and (qp.pattern_id IS not null or (qp.pattern_id is null and qp.qualification_ind in (0, 2))) and qp.list_header_id = qph.list_header_id
);
SELECT sum(c) FROM (
SELECT /*+ ordered use_nl(qpr, qph, qpaq) */ count(*) c
FROM qp_list_lines qplag, qp_list_headers_b qph, qp_pricing_attributes qpaq
WHERE qph.active_flag = 'Y' and qph.list_header_id = qplag.list_header_id and qpaq.list_line_id = qplag.list_line_id and qpaq.pricing_segment_id is not null and qplag.cache_key = p_cache_key and qpaq.comparison_operator_code <> '='
UNION ALL
SELECT /*+ ordered use_nl(qpr, qph, qpaq) */ count(*) c
FROM qp_list_lines qplag, qp_list_headers_b qph, qp_qualifiers qpaq
WHERE qph.active_flag = 'Y' and qph.list_header_id = qplag.list_header_id and qpaq.list_line_id = qplag.list_line_id and qpaq.segment_id is not null and qplag.cache_key = p_cache_key and qpaq.comparison_operator_code <> '='
UNION ALL
SELECT /*+ ordered use_nl(qpr, qph, qpaq) */ count(*) c
FROM qp_list_lines qpl, qp_rltd_modifiers qpr, qp_list_lines qplag, qp_list_headers_b qph, qp_pricing_attributes qpaq
WHERE qph.active_flag = 'Y' and qph.list_header_id = qplag.list_header_id and qpaq.list_line_id = qplag.list_line_id and qpaq.pricing_segment_id is not null and qpl.cache_key = p_cache_key
and qpl.list_line_id = qpr.from_rltd_modifier_id and qplag.list_line_id = qpr.to_rltd_modifier_id and qpaq.comparison_operator_code <> '='
UNION ALL
SELECT /*+ ordered use_nl(qpr, qph, qpaq) */ count(*) c
FROM qp_list_lines qpl, qp_rltd_modifiers qpr, qp_list_lines qplag, qp_list_headers_b qph, qp_qualifiers qpaq
WHERE qph.active_flag = 'Y' and qph.list_header_id = qplag.list_header_id and qpaq.list_line_id = qplag.list_line_id and qpaq.segment_id is not null and qpl.cache_key = p_cache_key
and qpl.list_line_id = qpr.from_rltd_modifier_id and qplag.list_line_id = qpr.to_rltd_modifier_id and qpaq.comparison_operator_code <> '='
);
SELECT count(*)
FROM mtl_uom_conversions
WHERE (disable_date is null or disable_date > sysdate) and inventory_item_id = p_cache_key;
SELECT count(*)
FROM mtl_uom_class_conversions
WHERE (disable_date is null or disable_date > sysdate) and inventory_item_id = p_cache_key;
SELECT count(*)
FROM qp_price_formulas
WHERE price_formula_id = p_cache_key;
SELECT count(*)
FROM qp_price_formula_lines
WHERE price_formula_id = p_cache_key;
SELECT count(*)
FROM qp_list_headers_b qph, qp_currency_lists_b qpc
WHERE qph.active_flag = 'Y' and qpc.currency_header_id = p_cache_key and qph.currency_code = qpc.base_currency_code;
SELECT count(*)
FROM qp_currency_details qpd
WHERE exists
(select 'X' from qp_list_headers_b
where list_type_code in ('AGR', 'PRL')
and active_flag = 'Y'
and currency_header_id = p_cache_key)
AND qpd.currency_header_id = p_cache_key;
SELECT
do_name,
do_size
FROM qp_cache_do_sizes
order by do_name;
l_last_update_date_final_tbl date_tbl_type;
l_last_updated_by_final_tbl number_tbl_type;
l_last_update_login_final_tbl number_tbl_type;
l_cache_key_val_tbl.delete;
l_cache_key_size_tbl.delete;
Insert into qp_cache_stats;
l_last_update_date_final_tbl(i) := sysdate;
l_last_updated_by_final_tbl(i) := FND_GLOBAL.USER_ID;
l_last_update_login_final_tbl(i) := FND_GLOBAL.LOGIN_ID;
DELETE FROM qp_cache_stats;
INSERT INTO qp_cache_stats (
name,
value,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
PROGRAM_APPLICATION_ID,
PROGRAM_ID,
PROGRAM_UPDATE_DATE,
REQUEST_ID)
VALUES (
l_cache_type_tbl(i),
l_cache_size_tbl(i),
l_creation_date_final_tbl(i),
l_created_by_final_tbl(i),
l_last_update_date_final_tbl(i),
l_last_updated_by_final_tbl(i),
l_last_update_login_final_tbl(i),
l_program_appl_id_final_tbl(i),
l_program_id_final_tbl(i),
l_program_upd_date_final_tbl(i),
l_request_id_final_tbl(i)
);
END UPDATE_CACHE_STATS;
PROCEDURE UPDATE_CAT_NO_PROD_PRICING IS
CURSOR cat_no_prod_mod_csr IS
SELECT DISTINCT 'M', category_id
FROM mtl_item_categories ic
WHERE NOT EXISTS (SELECT 1
FROM qp_pricing_attributes pa, qp_list_lines ll
WHERE pa.product_attribute_context = 'ITEM' and
pa.product_attribute = 'PRICING_ATTRIBUTE1' and
pa.product_attr_value = to_char(ic.inventory_item_id) and
ll.list_line_id = pa.list_line_id and
ll.list_line_type_code not in ('PLL'));
SELECT DISTINCT 'P', category_id
FROM mtl_item_categories ic
WHERE NOT EXISTS (SELECT 1
FROM qp_pricing_attributes pa, qp_list_lines ll
WHERE pa.product_attribute_context = 'ITEM' and
pa.product_attribute = 'PRICING_ATTRIBUTE1' and
pa.product_attr_value = to_char(ic.inventory_item_id) and
ll.list_line_id = pa.list_line_id and
ll.list_line_type_code in ('PLL'));
dbms_output.put_line('qp_java_engine_cache_pub.update_cat_no_prod_pricing');
DELETE FROM qp_cache_cat_no_prod_pricing;
INSERT INTO qp_cache_cat_no_prod_pricing (
cache_type,
category_id)
VALUES (
l_cat_no_prod_type_tbl(i),
l_cat_no_prod_cat_tbl(i)
);
INSERT INTO qp_cache_cat_no_prod_pricing (
cache_type,
category_id)
VALUES (
l_cat_no_prod_type_tbl(i),
l_cat_no_prod_cat_tbl(i)
);
END UPDATE_CAT_NO_PROD_PRICING;
update_cache_stats(
err_buff,
retcode
);