The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_select_stmt VARCHAR2(4000);
QP_MASS_MAINTAIN_UTIL.get_valueset_select('ITEM',
'ITEM_CATEGORY',
l_select_stmt,
'PRICING_ATTRIBUTE2',
p_item_pte,
p_item_ss);
l_select_stmt := l_select_stmt || ' WHERE attribute_id = ' || p_item_id;
EXECUTE IMMEDIATE l_select_stmt INTO l_attribute_id, x_item_name, x_item_desc;
l_where_clause := l_where_clause || 'select distinct utilmap.functional_area_id ';
SELECT 'Y' INTO x_is_used FROM qp_qualifiers
WHERE qualifier_context = p_context_code
AND qualifier_attribute = p_attribute_code AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM qp_limits
WHERE ((multival_attr1_context = p_context_code
AND multival_attribute1 = p_attribute_code)
OR (multival_attr2_context = p_context_code
AND multival_attribute2 = p_attribute_code)) AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM qp_limit_attributes
WHERE limit_attribute_context = p_context_code
AND limit_attribute = p_attribute_code AND rownum < 2;
SELECT 'Y'
INTO x_is_used FROM qp_pricing_attributes
WHERE pricing_attribute_context = p_context_code
AND pricing_attribute = p_attribute_code AND rownum < 2;
SELECT 'Y'
INTO x_is_used
FROM qp_price_formula_lines a, qp_list_lines b
WHERE a.pricing_attribute_context = p_context_code
AND a.pricing_attribute = p_attribute_code
AND a.price_formula_id = b.price_by_formula_id
AND rownum < 2;
SELECT 'Y'
INTO x_is_used
FROM qp_price_formula_lines a, qp_currency_details b
WHERE a.pricing_attribute_context = p_context_code
AND a.pricing_attribute = p_attribute_code
AND (a.price_formula_id = b.price_formula_id
OR a.price_formula_id = b.markup_formula_id)
AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM dual
where exists(SELECT 'Y'
FROM qp_pricing_attributes
WHERE product_attribute_context = p_context_code
AND product_attribute = p_attribute_code);
SELECT 'Y' INTO x_is_used FROM qp_limits
WHERE ((multival_attr1_context = p_context_code
AND multival_attribute1 = p_attribute_code)
OR (multival_attr2_context = p_context_code
AND multival_attribute2 = p_attribute_code)) AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM qp_limit_attributes
WHERE limit_attribute_context = p_context_code
AND limit_attribute = p_attribute_code AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM qp_qualifiers
WHERE qualifier_context = p_context_code
AND qualifier_attribute = p_attribute_code
AND active_flag = 'Y' AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM qp_limits a, qp_list_headers_b b
WHERE ((a.multival_attr1_context = p_context_code
AND a.multival_attribute1 = p_attribute_code)
OR (a.multival_attr2_context = p_context_code
AND a.multival_attribute2 = p_attribute_code))
AND a.list_header_id = b.list_header_id AND b.active_flag = 'Y'
AND rownum < 2;
SELECT 'Y' INTO x_is_used
FROM qp_limit_attributes a, qp_limits b, qp_list_headers_b c
WHERE a.limit_attribute_context = p_context_code
AND a.limit_attribute = p_attribute_code AND a.limit_id = b.limit_id
AND b.list_header_id = c.list_header_id AND c.active_flag = 'Y'
AND rownum < 2;
SELECT 'Y' INTO x_is_used FROM dual
where exists(SELECT 'Y' FROM qp_pricing_attributes qpa, qp_list_headers_b qph
WHERE qpa.pricing_attribute_context = p_context_code
AND qpa.pricing_attribute = p_attribute_code
AND qpa.list_header_id = qph.list_header_id
AND qph.active_flag = 'Y'
);
SELECT 'Y'
INTO x_is_used
FROM qp_price_formula_lines a, qp_list_lines b, qp_list_headers_b c
WHERE a.pricing_attribute_context = p_context_code
AND a.pricing_attribute = p_attribute_code
AND a.price_formula_id = b.price_by_formula_id
AND b.list_header_id = c.list_header_id
AND c.active_flag = 'Y'
AND rownum < 2;
SELECT 'Y'
INTO x_is_used
FROM qp_price_formula_lines a, qp_currency_details b
WHERE a.pricing_attribute_context = p_context_code
AND a.pricing_attribute = p_attribute_code
AND (a.price_formula_id = b.price_formula_id
OR a.price_formula_id = b.markup_formula_id)
AND rownum < 2;
SELECT 'Y'
INTO x_is_used FROM dual
WHERE exists (SELECT 'Y'
FROM qp_pricing_attributes a
WHERE product_attribute_context = p_context_code
AND product_attribute = p_attribute_code
AND exists (select 'x' from qp_list_headers_b b
where active_flag = 'Y' and a.list_header_id = b.list_header_id));
SELECT 'Y' INTO x_is_used FROM qp_limits a, qp_list_headers_b b
WHERE ((a.multival_attr1_context = p_context_code
AND a.multival_attribute1 = p_attribute_code)
OR (a.multival_attr2_context = p_context_code
AND a.multival_attribute2 = p_attribute_code))
AND a.list_header_id = b.list_header_id AND b.active_flag = 'Y'
AND rownum < 2;
SELECT 'Y' INTO x_is_used
FROM qp_limit_attributes a, qp_limits b, qp_list_headers_b c
WHERE a.limit_attribute_context = p_context_code
AND a.limit_attribute = p_attribute_code AND a.limit_id = b.limit_id
AND b.list_header_id = c.list_header_id AND c.active_flag = 'Y'
AND rownum < 2;
SELECT a.sourcing_enabled, a.sourcing_status,
nvl(a.user_sourcing_method, a.seeded_sourcing_method)
FROM qp_pte_segments a, qp_prc_contexts_b b,
qp_segments_b c
WHERE b.prc_context_code = a_context
AND b.prc_context_type = a_context_type
AND c.prc_context_id = b.prc_context_id
AND c.segment_mapping_column = a_attribute
AND a.segment_id = c.segment_id
AND a.pte_code = a_pte_code;
SELECT nvl(t.user_prc_context_name, t.seeded_prc_context_name), b.enabled_flag
FROM qp_prc_contexts_b b, qp_prc_contexts_tl t
WHERE b.prc_context_id = t.prc_context_id
AND t.language = userenv('LANG')
AND b.prc_context_code = a_context_code
AND b.prc_context_type = a_context_type;
SELECT a.prc_context_code, b.segment_mapping_column
FROM qp_prc_contexts_b a, qp_segments_b b
WHERE a.prc_context_id = b.prc_context_id
AND b.segment_code = UPPER(a_attribute_code);
SELECT a.prc_context_id
FROM qp_prc_contexts_b a, qp_segments_b b
WHERE a.prc_context_id = b.prc_context_id
AND b.segment_code = a_attribute_code
AND a.prc_context_type = 'QUALIFIER';
SELECT a.prc_context_id
FROM qp_prc_contexts_b a, qp_segments_b b
WHERE a.prc_context_id = b.prc_context_id
AND b.segment_code = a_attribute_code
AND a.prc_context_type = 'PRICING';
select a1.attribute_label_long into l_entity_code
from ak_object_attributes_tl a1,
oe_ak_obj_attr_ext a2
where a2.attribute_id = p_entity_id
and a1.language= userenv('lang')
and a2.pricing_rule_enabled_flag= 'Y'
and a2.attribute_code=a1.attribute_code
and a2.database_object_name= a1.database_object_name
and a2.attribute_application_id=a1.attribute_application_id;
SELECT prc_context_code
FROM qp_prc_contexts_b
WHERE prc_context_type = a_context_type
AND prc_context_code = a_context_code
AND enabled_flag = 'Y';
SELECT prc_context_id
FROM qp_prc_contexts_b
WHERE prc_context_type = a_context_type
AND prc_context_code = a_context_code;
SELECT nvl(user_valueset_id, seeded_valueset_id),
nvl(user_precedence, seeded_precedence)
FROM qp_segments_b a, qp_pte_segments b
WHERE a.prc_context_id = a_context_id
AND a.segment_mapping_column = a_segment_mapping_column
AND b.pte_code = a_pte_code
AND a.segment_id = b.segment_id
AND b.lov_enabled = 'Y';
SELECT nvl(user_valueset_id, seeded_valueset_id),
nvl(user_precedence, seeded_precedence)
FROM qp_segments_b a, qp_pte_segments b
WHERE a.prc_context_id = a_context_id
AND a.segment_mapping_column = a_segment_mapping_column
AND b.pte_code = a_pte_code
AND a.segment_id = b.segment_id;
v_selectstmt VARCHAR2(2000) ; --dhgupta changed length from 500 to 2000 for bug # 1888160
--included extra quotes for comparing varchar and num values in select
/* Commented out for 2492020
v_where_clause := replace(UPPER(p_table_r.where_clause)
,'WHERE '
,'WHERE '||p_table_r.id_column_name||' = '''||p_value||''' AND ');
v_selectstmt := 'SELECT '||v_cols||' FROM '||p_table_r.table_name||' '||v_where_clause;
oe_debug_pub.add('select stmt1'||v_selectstmt);
v_selectstmt := 'SELECT '||p_table_r.id_column_name||' FROM '||p_table_r.table_name||' '||v_where_clause;
v_selectstmt := 'SELECT '||p_table_r.value_column_name||' FROM '||p_table_r.table_name||' '||p_table_r.where_clause;
open v_cursor for v_selectstmt using p_value;
DBMS_SQL.PARSE(v_cursor_id,v_selectstmt,DBMS_SQL.V7);
SELECT application_id
FROM fnd_application
WHERE application_short_name = app_short_name;
SELECT application_id
FROM fnd_application
WHERE application_short_name = app_short_name;
SELECT application_id
FROM fnd_application
WHERE application_short_name = app_short_name;
SELECT nvl(a.user_valueset_id, a.seeded_valueset_id)
FROM qp_segments_b a, qp_prc_contexts_b b
WHERE a.prc_context_id = b.prc_context_id
AND b.prc_context_type = a_context_type
AND b.prc_context_code = a_context_code
AND a.segment_code = a_segment_code;
SELECT application_id
FROM fnd_application
WHERE application_short_name = app_short_name;
SELECT a.segment_mapping_column
FROM qp_segments_v a, qp_prc_contexts_b b
WHERE b.prc_context_id = a.prc_context_id
AND b.prc_context_code = a_context_code
AND a.segment_code = a_segment_name
AND a.segment_mapping_column like 'PRICING%';--deliberately matching a_segment_name
SELECT a.segment_mapping_column
FROM qp_segments_v a, qp_prc_contexts_b b
WHERE b.prc_context_id = a.prc_context_id
AND b.prc_context_code = a_context_code
AND a.segment_code = a_segment_name
AND a.segment_mapping_column like 'QUALIFIER%';--deliberately matching a_segment_name
SELECT NULL INTO dummy
FROM fnd_descr_flex_contexts
WHERE application_id = p_application_id
AND descriptive_flexfield_name = p_descriptive_flexfield_name
AND descriptive_flex_context_code = p_descr_flex_context_code;
select NULL INTO dummy
from FND_DESCR_FLEX_COLUMN_USAGES
where APPLICATION_ID = p_application_id
and DESCRIPTIVE_FLEX_CONTEXT_CODE = p_context_code
and DESCRIPTIVE_FLEXFIELD_NAME = p_flexfield_name
and APPLICATION_COLUMN_NAME = p_application_column_name;
select NULL INTO dummy
from FND_DESCR_FLEX_COLUMN_USAGES
where APPLICATION_ID = p_application_id
and DESCRIPTIVE_FLEX_CONTEXT_CODE = p_context_code
and DESCRIPTIVE_FLEXFIELD_NAME = p_flexfield_name
and END_USER_COLUMN_NAME = p_segment_name;
--dbms_output.put_line('Trying to delete segments under old context');
FND_FLEX_DSC_API.DELETE_SEGMENT( P_NEW_PRODUCT
,P_NEW_FLEXFIELD_NAME
,OLD_GDE_CONTEXT_CODE -- Global Data Elements
,NEW_GDE_SEGMENTS.SEGMENT_NAME(I));
SELECT FLEX_VALUE_SET_NAME INTO
L_VALUE_SET
FROM FND_FLEX_VALUE_SETS
WHERE FLEX_VALUE_SET_ID = L_VALUE_SET_ID;
SELECT FLEX_VALUE_SET_NAME INTO
L_VALUE_SET
FROM FND_FLEX_VALUE_SETS
WHERE FLEX_VALUE_SET_ID = L_VALUE_SET_ID;
SELECT FLEX_VALUE_SET_NAME INTO
L_VALUE_SET
FROM FND_FLEX_VALUE_SETS
WHERE FLEX_VALUE_SET_ID = L_VALUE_SET_ID;
INSERT INTO QP_UPGRADE_ERRORS(ERROR_ID,UPG_SESSION_ID,ID1,ID2,ID3,ID4,ID5,ID6,ID7,ID8,ERROR_TYPE,
ERROR_DESC,ERROR_MODULE,CREATION_DATE,CREATED_BY,LAST_UPDATE_DATE,
LAST_UPDATED_BY,LAST_UPDATE_LOGIN) VALUES
(QP_UPGRADE_ERRORS_S.NEXTVAL,USERENV('SESSIONID'),
P_ID1,P_ID2,P_ID3,P_ID4,P_ID5,P_ID6,P_ID7,P_ID8,
P_ERROR_TYPE, SUBSTR(P_ERROR_DESC,1,240),P_ERROR_MODULE,SYSDATE,
FND_GLOBAL.USER_ID,SYSDATE,FND_GLOBAL.USER_ID,FND_GLOBAL.LOGIN_ID);
SELECT application_id
FROM fnd_application
WHERE application_short_name = app_short_name;
SELECT application_id
FROM fnd_application
WHERE application_short_name = app_short_name;
select name
from ra_salesreps r
where r.salesrep_id = a_salesrep_id;
select t.name
from ra_terms_b b ,ra_terms_tl t
where b.term_id = a_term_id and
b.term_id = t.term_id and
t.language = userenv('LANG');
v_selectstmt VARCHAR2(2000) ; --dhgupta changed length from 500 to 2000 for bug # 1888160
--included extra quotes for comparing varchar and num values in select
/* Commented out for 2492020
v_where_clause := replace(UPPER(p_table_r.where_clause)
,'WHERE '
,'WHERE '||p_table_r.id_column_name||' = '''||p_value||''' AND ');
v_selectstmt := 'SELECT '||v_cols||' FROM '||p_table_r.table_name||' '||v_where_clause;
oe_debug_pub.add('select stmt2'||v_selectstmt);
v_selectstmt := 'SELECT '||p_table_r.id_column_name||' FROM '||p_table_r.table_name||' '||v_where_clause;
v_selectstmt := 'SELECT '||p_table_r.value_column_name||' FROM '||p_table_r.table_name||' '||p_table_r.where_clause;
open v_cursor for v_selectstmt using p_value;
DBMS_SQL.PARSE(v_cursor_id,v_selectstmt,DBMS_SQL.V7);
select source_system_code
, list_type_code
, pte_code
into l_source_system_code
, l_list_type_code
, l_pte_code
from qp_list_headers_b
where list_header_id = p_list_header_id;
select lh.source_system_code
, lh.list_type_code
, lh.pte_code
into l_source_system_code
, l_list_type_code
, l_pte_code
from qp_list_headers_b lh,
qp_list_lines ll
where ll.list_line_id = p_list_line_id
and lh.list_header_id = ll.list_header_id;
SELECT nvl(a.user_segment_name, a.seeded_segment_name),
b.segment_code
FROM qp_segments_tl a, qp_segments_b b,
qp_prc_contexts_b c, qp_pte_segments d
WHERE c.prc_context_type = a_context_type
AND c.prc_context_code = a_context_code
AND c.prc_context_id = b.prc_context_id
AND b.segment_mapping_column = a_attribute
AND b.segment_id = a.segment_id
AND a.language = userenv('LANG')
AND b.segment_id = d.segment_id
AND d.pte_code = a_pte_code;
select form_left_prompt,end_user_column_name
INTO x_attribute_code,x_segment_name
from FND_DESCR_FLEX_COL_USAGE_VL
where APPLICATION_ID = 661 and
DESCRIPTIVE_FLEXFIELD_NAME = p_FlexField_Name and
DESCRIPTIVE_FLEX_CONTEXT_CODE = p_Context_Name and
application_column_name = p_attribute and
enabled_flag='Y';
select c.segment_level
into l_segment_level
from qp_prc_contexts_b a,
qp_segments_b b,
qp_pte_segments c,
qp_list_headers_b d
where a.prc_context_id = b.prc_context_id
and b.segment_id = c.segment_id
and c.pte_code = d.pte_code
and d.list_header_id = p_list_header_id
and a.prc_context_code = p_context
and b.SEGMENT_MAPPING_COLUMN = p_attribute;
SELECT a.prc_context_code,
nvl(b.user_prc_context_name, b.seeded_prc_context_name)
prc_context_name,
a.enabled_flag, a.prc_context_type
FROM qp_prc_contexts_b a, qp_prc_contexts_tl b
WHERE a.prc_context_id = b.prc_context_id
AND b.language = userenv('LANG')
AND EXISTS (SELECT 'x'
FROM qp_segments_b c, qp_pte_segments d
WHERE d.pte_code = a_pte_code
AND c.segment_id = d.segment_id
AND c.prc_context_id = a.prc_context_id
AND d.lov_enabled = 'Y'
AND (a_limits = 'Y' AND d.limits_enabled = 'Y'
OR
a_limits <> 'Y')
AND (a_qp_status = 'S' AND
(c.availability_in_basic = 'Y' OR
c.availability_in_basic = 'F' AND
a_list_line_type_code = 'FREIGHT_CHARGE')
OR
a_qp_status <> 'S')
);
SELECT a.segment_mapping_column,
nvl(b.user_segment_name, b.seeded_segment_name) segment_name,
a.segment_code, nvl(a.user_precedence, a.seeded_precedence) precedence,
d.prc_context_code, d.prc_context_type, c.lov_enabled,
a.availability_in_basic, c.limits_enabled, c.segment_level,
nvl(a.user_valueset_id, a.seeded_valueset_id) valueset_id
FROM qp_segments_b a, qp_segments_tl b,
qp_pte_segments c, qp_prc_contexts_b d
WHERE d.prc_context_type = a_context_type
AND d.prc_context_code = a_context_code
AND a.prc_context_id = d.prc_context_id
AND a.segment_id = b.segment_id
AND b.language = userenv('LANG')
AND c.pte_code = a_pte_code
AND c.segment_id = b.segment_id;
SELECT inventory_organization_id
INTO l_inv_org_id
--fix for bug 4776045 for MOAC
--FROM financials_system_parameters;
SELECT 'X'
INTO l_dummy
FROM hr_operating_units hr
WHERE hr.organization_id = p_org_id
AND MO_GLOBAL.check_access(hr.organization_id) = 'Y';
select name
into l_operating_unit
from hr_operating_units
where organization_id = p_org_id;
SELECT pte_code, source_system_code
INTO x_pte_code, x_source_system_code
FROM qp_list_headers_b
WHERE list_header_id = p_list_header_id;
SELECT name
INTO l_db_name
FROM v$database;
SELECT user_id
INTO l_dm_user_id
FROM fnd_user
WHERE user_name = 'DATAMERGE';
SELECT 'VALID' INTO l_dummy
FROM mtl_system_items_b
where inventory_item_id = p_product_attr_val
AND ((l_appl_id not in (178,201) and customer_order_flag = 'Y')
or (l_appl_id in (178, 201) and NVL(PURCHASING_ENABLED_FLAG, 'N') ='Y'))
and organization_id = Get_Item_Validation_Org;