The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select GETALPHABET(Decode( l_mod,0,l_floor-1,l_floor),type) into l_out from dual;
SELECT l_out||fnd_global.local_chr(26+decode(type,'L',96,'U',64))
into l_out from dual;
SELECT l_out||fnd_global.local_chr(l_mod+decode(type,'L',96,'U',64))
into l_out from dual;
Select decode(p_level,1,l_lvl1_seq_code,2,l_lvl2_seq_code,3,l_lvl3_seq_code,4,l_lvl4_seq_code,5,l_lvl5_seq_code,NULL)
INTO l_vl_seq_code from dual;
SELECT ID,'SECTION' TYPE,section_sequence display_sequence from okc_sections_b
where scn_id=p_scn_id
and document_type=p_doc_type
and document_id = p_doc_id
AND nvl(amendment_operation_code,'?') <> 'DELETED'
AND nvl(summary_amend_operation_code,'?') <> 'DELETED'
UNION
SELECT ID,'ARTICLE' TYPE,display_sequence display_sequence from okc_k_ARTICLES_b
where scn_id=p_scn_id
and document_type=p_doc_type
and document_id = p_doc_id
AND nvl(amendment_operation_code,'?') <> 'DELETED'
AND nvl(summary_amend_operation_code,'?') <> 'DELETED'
AND l_number_article_yn = 'Y'
Order by 3;
select decode(p_level,1,NULL,2,l_lvl1_concat_yn,3,l_lvl2_concat_yn,4,l_lvl3_concat_yn,5,l_lvl4_concat_yn,'N'),
decode(p_level,1,l_lvl1_end_char ,2,l_lvl2_end_char ,3,l_lvl3_end_char ,4,l_lvl4_end_char ,5,l_lvl5_end_char ,NULL)
into l_concat_yn ,l_end_char from dual;
p_update_db IN VARCHAR2 ,
p_num_scheme_id IN NUMBER
) IS
Cursor l_num_sch_dtl_crs IS
SELECT decode(Num_Sequence_code, G_NUMBER_SEQUENCE,'1',G_LOWERCASE_ENG_ALPHABETS,'a',G_UPPERCASE_ENG_ALPHABETS,'A',G_LOWERCASE_ROMAN_NUMBER,'i',G_UPPERCASE_ROMAN_NUMBER,'I') label1,
decode(Num_Sequence_code, G_NUMBER_SEQUENCE,'2',G_LOWERCASE_ENG_ALPHABETS,'b',G_UPPERCASE_ENG_ALPHABETS,'B',G_LOWERCASE_ROMAN_NUMBER,'ii',G_UPPERCASE_ROMAN_NUMBER,'II')label2,
concatenation_yn,
sequence_level,
End_character
FROM OKC_NUMBER_SCHEME_DTLS
WHERE Num_scheme_Id = p_num_scheme_id
order by Sequence_Level;
SELECT
decode(l_concat_yn,'Y',l_label||'.'||decode(k,1,decode(i,1,cr.label1,2,cr.label2,cr.label1),cr.label1),decode(k,1,decode(i,1,cr.label1,2,cr.label2,cr.label1),cr.label1))
INTO l_label FROM DUAL;
IF p_update_db=FND_API.G_TRUE THEN
Update OKC_NUMBER_SCHEMES_B SET
num_scheme_preview = x_out_string,
object_version_number = object_version_number+1,
creation_date = sysdate,
created_by = Fnd_Global.User_Id,
last_update_date = sysdate,
last_updated_by = Fnd_Global.User_Id,
last_update_login = Fnd_Global.Login_Id
WHERE num_scheme_id = p_num_scheme_id;
SELECT ID,section_sequence from okc_sections_b
where document_type = p_doc_type
AND document_id = p_doc_id
AND SCN_ID IS NULL
AND nvl(amendment_operation_code,'?') <> 'DELETED'
AND nvl(summary_amend_operation_code,'?') <> 'DELETED'
Order by section_sequence;
SELECT number_article_yn from OKC_NUMBER_SCHEMES_B
where num_scheme_id=p_num_scheme_id;
SELECT num_sequence_code,sequence_level,concatenation_yn,end_character from OKC_NUMBER_SCHEME_DTLS
where num_scheme_id=p_num_scheme_id;
SELECT template_id,object_version_number from OKC_template_usages
where document_type=p_doc_type and document_id=p_doc_id;
SELECT id,object_version_number
FROM okc_k_articles_b
WHERE document_type=p_doc_type
AND document_id=p_doc_id
AND nvl(amendment_operation_code,'?') <> 'DELETED'
AND nvl(summary_amend_operation_code,'?') <> 'DELETED'
AND label is NOT NULL;
SELECT COUNT(*)
FROM OKC_NUMBER_SCHEME_DTLS
WHERE num_scheme_id=p_num_scheme_id;
l_structure_tbl.DELETE;
UPDATE okc_sections_b
SET label = NULL
WHERE document_type = p_doc_type
AND document_id = p_doc_id ;
UPDATE okc_k_articles_b
SET label = NULL
WHERE document_type = p_doc_type
AND document_id = p_doc_id ;
okc_debug.log('170: Calling OKC_TERMS_SECTIONS_GRP.update_section', 2);
G_PKG_NAME, '170: Calling OKC_TERMS_SECTIONS_GRP.update_section' );
OKC_TERMS_SECTIONS_GRP.update_section(
p_api_version => 1,
p_init_msg_list => FND_API.G_FALSE,
p_mode => 'NORMAL',
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_id => l_structure_tbl(k).id,
p_label => l_structure_tbl(k).label,
p_object_version_number => NULL
);
okc_debug.log('170: After Calling OKC_TERMS_SECTIONS_GRP.update_section x_return_status : '||x_return_status, 2);
G_PKG_NAME, '170: After Calling OKC_TERMS_SECTIONS_GRP.update_section x_return_status : '||x_return_status );
okc_debug.log('180: Calling OKC_K_ARTICLES_GRP.update_article', 2);
G_PKG_NAME, '180: Calling OKC_K_ARTICLES_GRP.update_article');
OKC_K_ARTICLES_GRP.update_article(
p_api_version => 1,
p_init_msg_list => FND_API.G_FALSE,
p_mode => 'NORMAL',
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_id => l_structure_tbl(k).id,
p_label => l_structure_tbl(k).label,
p_object_version_number => NULL
);
okc_debug.log('180: After Calling OKC_TERMS_SECTIONS_GRP.update_section x_return_status : '||x_return_status, 2);
G_PKG_NAME, '180: After Calling OKC_TERMS_SECTIONS_GRP.update_section x_return_status : '||x_return_status );
/******* Not needed as all the labels are being updated in the begining itself
IF l_number_article_yn <>'Y' THEN
-- if any articles are already numbered, make label to null
FOR cr in l_get_art_csr LOOP
OKC_K_ARTICLES_GRP.update_article(
p_api_version => 1,
p_init_msg_list => FND_API.G_FALSE,
p_mode => 'NORMAL',
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_id => cr.id,
p_label => OKC_API.G_MISS_CHAR,
p_object_version_number => cr.object_version_number
);
okc_debug.log('300: OKC_TERMS_TEMPLATES_GRP.update_template', 2);
G_PKG_NAME, '300: OKC_TERMS_TEMPLATES_GRP.update_template' );
OKC_TERMS_TEMPLATES_GRP.update_template(
p_api_version => 1,
p_init_msg_list => FND_API.G_FALSE,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_template_name => NULL,
p_template_id => p_doc_id,
p_working_copy_flag =>NULL,
p_intent =>NULL,
p_status_code =>NULL,
p_start_date =>NULL,
p_end_date =>NULL,
p_global_flag =>NULL,
p_parent_template_id =>NULL,
p_print_template_id =>NULL,
p_contract_expert_enabled =>NULL,
p_template_model_id =>NULL,
p_instruction_text =>NULL,
p_tmpl_numbering_scheme =>p_num_scheme_id,
p_description =>NULL,
p_org_id => NULL,
p_object_version_number => NULL
);
okc_debug.log('300: After Call to OKC_TERMS_TEMPLATES_GRP.update_template x_return_status : '||x_return_status, 2);
G_PKG_NAME, '300: After Call to OKC_TERMS_TEMPLATES_GRP.update_template x_return_status : '||x_return_status );
okc_debug.log('400: OKC_TEMPLATE_USAGES_GRP.update_template_usages', 2);
G_PKG_NAME, '400: OKC_TEMPLATE_USAGES_GRP.update_template_usages' );
OKC_TEMPLATE_USAGES_GRP.update_template_usages(
p_api_version =>1,
p_init_msg_list => FND_API.G_FALSE,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_document_type => p_doc_type,
p_document_id => p_doc_id,
p_template_id => cr.template_id,
p_doc_numbering_scheme=>p_num_scheme_id ,
p_document_number =>NULL,
p_article_effective_date => NULL,
p_config_header_id =>NULL,
p_config_revision_number =>NULL,
p_valid_config_yn =>NULL,
p_object_version_number =>cr.object_version_number
);
okc_debug.log('400: After Call to OKC_TEMPLATE_USAGES_GRP.update_template_usages x_return_status : '||x_return_status, 2);
G_PKG_NAME, '400: After Call to OKC_TEMPLATE_USAGES_GRP.update_template_usages x_return_status : '||x_return_status );
FUNCTION Ok_To_Delete(
p_num_scheme_id IN NUMBER
) RETURN VARCHAR2 IS
CURSOR used_in_tmpl_crs IS
SELECT 'N' from OKC_TERMS_TEMPLATES_ALL
WHERE TMPL_NUMBERING_SCHEME=p_num_scheme_id;
SELECT 'N' from OKC_TEMPLATE_USAGES_V
WHERE DOC_NUMBERING_SCHEME=p_num_scheme_id;
END Ok_To_Delete;
SELECT review_upld_terms_id,
object_type TYPE,
display_seq,
object_id
from okc_review_upld_terms
where new_parent_id=p_review_upld_terms_id
and document_type=p_doc_type
and document_id = p_doc_id
and (object_type = 'SECTION'
OR (object_type = 'ARTICLE'
and l_number_article_yn = 'Y'))
/***********
UNION
SELECT review_upld_terms_id,'ARTICLE' TYPE,display_seq, object_id from okc_review_upld_terms
where new_parent_id=p_review_upld_terms_id
and document_type=p_doc_type
and document_id = p_doc_id
and object_type = 'ARTICLE'
*********/
Order by 3;
select decode(p_level,1,NULL,2,l_lvl1_concat_yn,3,l_lvl2_concat_yn,4,l_lvl3_concat_yn,5,l_lvl4_concat_yn,'N'),
decode(p_level,1,l_lvl1_end_char ,2,l_lvl2_end_char ,3,l_lvl3_end_char ,4,l_lvl4_end_char ,5,l_lvl5_end_char ,NULL)
into l_concat_yn ,l_end_char from dual;
SELECT review_upld_terms_id,display_seq, object_id
from okc_review_upld_terms
where document_type = p_doc_type
AND document_id = p_doc_id
AND object_type = 'SECTION'
--and (action <> 'DELETED' OR action is null)
AND new_parent_id = (select review_upld_terms_id
from okc_review_upld_terms rt
where rt.document_type = p_doc_type
and rt.document_id = p_doc_id
and rt.object_type = p_doc_type
and rt.object_id = p_doc_id)
Order by display_seq;
SELECT number_article_yn from OKC_NUMBER_SCHEMES_B
where num_scheme_id=p_num_scheme_id;
SELECT num_sequence_code,sequence_level,concatenation_yn,end_character from OKC_NUMBER_SCHEME_DTLS
where num_scheme_id=p_num_scheme_id;
SELECT review_upld_terms_id,object_version_number, object_id
FROM okc_review_upld_terms
WHERE document_type=p_doc_type
AND document_id=p_doc_id
AND object_type = 'ARTICLE'
and action <> 'DELETED';
SELECT COUNT(*)
FROM OKC_NUMBER_SCHEME_DTLS
WHERE num_scheme_id=p_num_scheme_id;
l_review_tbl.DELETE;
UPDATE okc_review_upld_terms
SET label = NULL
WHERE document_type = p_doc_type
AND document_id = p_doc_id ;
G_PKG_NAME, '170: Calling OKC_REVIEW_UPLD_TERMS_PVT.update_row');
OKC_REVIEW_UPLD_TERMS_PVT.update_row(
x_return_status => x_return_status,
p_review_upld_terms_id => l_review_tbl(k).review_upld_terms_id,
p_label => l_review_tbl(k).label,
p_object_version_number => NULL);
G_PKG_NAME, '170: After Calling OKC_REVIEW_UPLD_TERMS_PVT.update_row x_return_status : '||x_return_status );