The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 1
FROM ams_source_codes
WHERE source_code = p_source_code;
SELECT DECODE (p_global_flag, 'Y', area1_code, area2_code)
FROM jtf_loc_hierarchies_vl
WHERE location_hierarchy_id = p_loc_hierarchy_id
;
SELECT cte.source_code_suffix
FROM ams_custom_setups_vl cte
WHERE cte.custom_setup_id = p_id
;
SELECT TO_CHAR(ams_source_codes_gen_s.NEXTVAL)
FROM DUAL;
SELECT tag
FROM ams_lookups
WHERE lookup_type = l_lookup_type
AND lookup_code = p_type_code;
SELECT campaign_type
FROM ams_campaigns_vl
WHERE campaign_id = p_parent_id;
SELECT event_type_code
FROM ams_event_headers_vl
WHERE event_header_id = p_parent_id;
SELECT budget_code_suffix
FROM ams_categories_vl
WHERE category_id = p_category_id;
SELECT TO_CHAR(ams_source_codes_gen_s.NEXTVAL)
FROM DUAL;
SELECT source_code_id, active_flag
FROM ams_source_codes
WHERE source_code = p_sourcecode;
SELECT 'x'
FROM ams_source_codes
WHERE arc_source_code_for = p_sourcecode_for
AND source_code_for_id = p_sourcecode_for_id
AND active_flag = 'Y';
SELECT AMS_SOURCE_CODES_S.NEXTVAL
FROM DUAL;
SELECT 1
FROM ams_source_codes
WHERE source_code = p_related_sourcecode;
AMS_Utility_PVT.debug_message(l_full_name ||': insert source code');
-- insert source code
insert into AMS_SOURCE_CODES (
SOURCE_CODE_ID,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
OBJECT_VERSION_NUMBER,
SOURCE_CODE,
SOURCE_CODE_FOR_ID,
ARC_SOURCE_CODE_FOR,
ACTIVE_FLAG
,RELATED_SOURCE_CODE
,RELATED_SOURCE_OBJECT
,RELATED_SOURCE_ID)
values (
l_sourcecode_id,
SYSDATE,
FND_GLOBAL.user_id,
SYSDATE,
FND_GLOBAL.user_id,
FND_GLOBAL.conc_login_id,
1, -- object_version_number,
p_sourcecode,
p_sourcecode_for_id,
p_sourcecode_for,
l_active_flag
,p_related_sourcecode
,p_releated_sourceobj
,p_related_sourceid
);
update AMS_SOURCE_CODES
set active_flag = 'N',
OBJECT_VERSION_NUMBER = OBJECT_VERSION_NUMBER + 1
where SOURCE_CODE = p_sourcecode;
update AMS_SOURCE_CODES
set ARC_SOURCE_CODE_FOR = p_object_type,
SOURCE_CODE_FOR_ID = p_object_id,
OBJECT_VERSION_NUMBER = OBJECT_VERSION_NUMBER + 1,
ACTIVE_FLAG = 'Y'
,RELATED_SOURCE_CODE = p_related_sourcecode
,RELATED_SOURCE_OBJECT = p_releated_sourceobj
,RELATED_SOURCE_ID = p_related_sourceid
where SOURCE_CODE_ID = p_sourcecode_id;
SELECT gde.scode_number_element
FROM ams_generated_codes gde
WHERE gde.scode_char_element = x_code_key
FOR UPDATE
;
INSERT INTO ams_generated_codes (
gen_code_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
object_version_number,
scode_char_element,
scode_number_element,
arc_source_code_for
) VALUES (
ams_source_codes_gen_s.NEXTVAL,
SYSDATE,
FND_GLOBAL.user_id,
SYSDATE,
FND_GLObAL.user_id,
FND_GLOBAL.conc_login_id,
1, -- object version number
l_code_chars,
0,
'NONE' -- Not generated for any specific object
);
UPDATE ams_generated_codes gde
SET gde.scode_number_element = l_sequence_value
WHERE gde.scode_char_element = l_code_chars;