The following lines contain the word 'select', 'insert', 'update' or 'delete':
, x_context_select_id OUT NOCOPY JTF_NUMBER_TABLE
, x_context_select_name OUT NOCOPY JTF_VARCHAR2_TABLE_2000
, x_context_select_details OUT NOCOPY JTF_VARCHAR2_TABLE_2000
, x_return_status OUT NOCOPY VARCHAR2
, x_msg_count OUT NOCOPY NUMBER
, x_msg_data OUT NOCOPY VARCHAR2
) AS
CURSOR c_get_note_contexts
(
p_note_id NUMBER
) IS
SELECT JNS.note_context_id note_context_id,
JNS.jtf_note_id jtf_note_id,
--Bug # 1978242, change everything to Party
DECODE(JNS.note_context_type,'PARTY_ORGANIZATION','PARTY','PARTY_PERSON',
'PARTY','PARTY_RELATIONSHIP','PARTY',JNS.note_context_type) note_context_type,
JNS.note_context_type_id note_context_type_id,
JOB.select_id select_id,
JOB.select_name select_name,
JOB.select_details select_details,
JOB.from_table from_table,
JOB.where_clause where_clause,
JOB.order_by_clause order_by_clause,
JOL.NAME note_context_type_name
FROM JTF_OBJECTS_TL JOL,
JTF_OBJECTS_B JOB,
JTF_NOTE_CONTEXTS JNS
WHERE JNS.JTF_NOTE_ID = p_note_id
AND JOB.OBJECT_CODE = DECODE(JNS.note_context_type,'PARTY_ORGANIZATION','PARTY',
'PARTY_PERSON','PARTY','PARTY_RELATIONSHIP','PARTY',JNS.note_context_type)
AND JOL.OBJECT_CODE = JOB.OBJECT_CODE
AND JOL.LANGUAGE = USERENV('LANG');
l_context_select_name VARCHAR2(2000);
l_context_select_details VARCHAR2(2000);
x_context_select_id := JTF_NUMBER_TABLE();
x_context_select_name := JTF_VARCHAR2_TABLE_2000();
x_context_select_details := JTF_VARCHAR2_TABLE_2000();
x_context_select_id.extend(x_context_count);
x_context_select_name.extend(x_context_count);
x_context_select_details.extend(x_context_count);
x_context_select_id(x_context_count) := ref_note_contexts.note_context_type_id;
x_context_select_name(x_context_count) := NULL;
x_context_select_details(x_context_count) := NULL;
IF ((ref_note_contexts.select_id IS NOT NULL) AND
(ref_note_contexts.select_name IS NOT NULL) AND
(ref_note_contexts.from_table IS NOT NULL))
THEN
l_jtf_objects_sql := 'SELECT ' || ref_note_contexts.select_name;
IF (ref_note_contexts.select_details IS NOT NULL)
THEN
l_jtf_objects_sql := l_jtf_objects_sql || ',' ||
ref_note_contexts.select_details;
l_jtf_objects_sql := l_jtf_objects_sql || ref_note_contexts.select_id ||
' = :note_context_type_id';
INTO x_context_select_name(x_context_count),
x_context_select_details(x_context_count)
USING ref_note_contexts.note_context_type_id;
x_context_select_name(x_context_count) := NULL;
x_context_select_details(x_context_count) := NULL;
SELECT NOTES_DETAIL
FROM JTF_NOTES_TL
WHERE JTF_NOTE_ID = p_note_id
AND LANGUAGE = USERENV('LANG');
SELECT attached_document_id
FROM FND_ATTACHED_DOCS_FORM_VL
WHERE function_name = 'JTF_CAL_ATTACHMENTS'
AND function_type = 'F'
AND (security_type = 4 OR publish_flag = 'Y')
AND entity_name = 'JTF_NOTES_B'
AND pk1_value = p_note_id;
SELECT DECODE(DBMS_LOB.SUBSTR(notes_detail,1,1),NULL,'N','Y') hasCLOB
FROM jtf_notes_tl
WHERE jtf_note_id = p_note_id
AND language = userenv('LANG');
)IS SELECT job.select_id
, job.select_name
, job.from_table
FROM jtf_objects_b job
WHERE job.object_code = b_object_code;
IF ( (r_object.select_id IS NULL)
OR (r_object.select_name IS NULL)
OR (r_object.from_table IS NULL)
)
THEN
l_return := 'N';
FUNCTION SelectNameVARCHAR2
( p_select_name IN VARCHAR2
) RETURN VARCHAR2
IS
BEGIN
RETURN p_select_name;
END SelectNameVARCHAR2;
FUNCTION SelectNameVARCHAR2
( p_select_name IN NUMBER
) RETURN VARCHAR2
IS
BEGIN
RETURN TO_CHAR(p_select_name);
END SelectNameVARCHAR2;