The following lines contain the word 'select', 'insert', 'update' or 'delete':
* Updated By For *
* *
* Peter Lowe 07/10/08 BUG 7249054 *
* Peter Lowe 08/01/08 BUG 7293765 *
* *
*****************************************************************
*/
-- Global variables
G_PKG_NAME CONSTANT VARCHAR2(30):='GR_FIELD_NAME_CLASSES_PUB';
l_last_update_login NUMBER(15,0) := 0;
l_allow_create_update VARCHAR2(1);
SELECT lng.language_code
FROM fnd_languages lng
WHERE lng.language_code = l_language_code;
SELECT count (language_code)
FROM fnd_languages
WHERE installed_flag IN ('I', 'B')
AND language_code not in
(SELECT language
FROM GR_LABEL_CLASSES_TL
WHERE label_class_code = p_field_name_class);
SELECT lcb.label_class_code, lcb.form_block
FROM gr_label_classes_b lcb
WHERE lcb.label_class_code = p_field_name_class;
SELECT 1
FROM GR_LABEL_CLASSES_TL
WHERE label_class_code = p_field_name_class
and language = p_language;
select 1
from fnd_responsibility
where responsibility_id = l_responsibility_id;
select responsibility_id
from fnd_responsibility_vl
where responsibility_name = l_responsibility;
select 1
from GR_LABEL_CLASS_RESPS
where LABEL_CLASS_CODE = p_field_name_class;
select 1
from GR_LABEL_CLASS_RESPS
where LABEL_CLASS_CODE = p_field_name_class
and APPLICATION_ID = 557
and RESPONSIBILITY_ID = l_responsibility_id;
select 1
from GR_LABEL_CLASS_RESPS
where LABEL_CLASS_CODE = p_field_name_class
and APPLICATION_ID = 557
and display_sequence = l_display_sequence;
gr_label_classes_b_pkg.Insert_Row
(p_commit => 'T',
p_called_by_form => 'F',
p_label_class_code => p_field_name_class,
p_form_block => l_form_block,
p_rollup_type => NULL,
p_rollup_property => NULL,
p_rollup_label => NULL,
p_attribute_category => NULL,
p_attribute1 => NULL,
p_attribute2 => NULL,
p_attribute3 => NULL,
p_attribute4 => NULL,
p_attribute5 => NULL,
p_attribute6 => NULL,
p_attribute7 => NULL,
p_attribute8 => NULL,
p_attribute9 => NULL,
p_attribute10 => NULL,
p_attribute11 => NULL,
p_attribute12 => NULL,
p_attribute13 => NULL,
p_attribute14 => NULL,
p_attribute15 => NULL,
p_attribute16 => NULL,
p_attribute17 => NULL,
p_attribute18 => NULL,
p_attribute19 => NULL,
p_attribute20 => NULL,
p_attribute21 => NULL,
p_attribute22=> NULL,
p_attribute23 => NULL,
p_attribute24 => NULL,
p_attribute25 => NULL,
p_attribute26 => NULL,
p_attribute27 => NULL,
p_attribute28 => NULL,
p_attribute29 => NULL,
p_attribute30 => NULL,
p_created_by => FND_GLOBAL.USER_ID,
p_creation_date => SYSDATE,
p_last_updated_by => FND_GLOBAL.USER_ID,
p_last_update_date => SYSDATE,
p_last_update_login => l_last_update_login,
x_rowid => row_id,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
gr_label_classes_tl_pkg.insert_row(
p_commit => 'T',
p_called_by_form => 'F',
p_label_class_code => p_field_name_class,
p_language => p_language,
p_label_class_description => p_description,
p_source_lang => p_source_language,
p_created_by => fnd_global.user_id,
p_creation_date => sysdate,
p_last_updated_by => fnd_global.user_id,
p_last_update_date => sysdate,
p_last_update_login => l_last_update_login,
x_rowid => row_id,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
-- Insert a record into GR_LABEL_CLASSES_TL for each installed language.
OPEN Cur_count_language;
-- Insert a record into GR_LABEL_CLASS_RESPS for each valid record in the passed table.
FOR i IN 1 .. p_label_class_resp_tab.count LOOP
l_responsibility_id := p_label_class_resp_tab(i).responsibility_id;
l_allow_create_update := p_label_class_resp_tab(i).allow_create_update;
-- Insert a record into GR_LABEL_CLASS_RESPS for each valid record in the passed table
insert into gr_label_class_resps (
label_class_code, application_id, responsibility_id, display_sequence,
allow_create_update, created_by, creation_date, last_updated_by,
last_update_date, last_update_login ) values
( p_field_name_class,
l_application_id,
l_responsibility_id,
l_display_sequence,
l_allow_create_update,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
l_last_update_login
);
gr_label_classes_tl_pkg.insert_row(
p_commit => 'T',
p_called_by_form => 'F',
p_label_class_code => p_field_name_class,
p_language => p_language,
p_label_class_description => p_description,
p_source_lang => p_source_language,
p_created_by => fnd_global.user_id,
p_creation_date => sysdate,
p_last_updated_by => fnd_global.user_id,
p_last_update_date => sysdate,
p_last_update_login => l_last_update_login,
x_rowid => row_id,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
l_allow_create_update := p_label_class_resp_tab(i).allow_create_update;
-- Insert a record into GR_LABEL_CLASS_RESPS for each valid record in the passed table
insert into gr_label_class_resps (
label_class_code, application_id, responsibility_id, display_sequence,
allow_create_update, created_by, creation_date, last_updated_by,
last_update_date, last_update_login ) values
( p_field_name_class,
l_application_id,
l_responsibility_id,
l_display_sequence,
l_allow_create_update,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
l_last_update_login
);
-- The value of Form Block will be updated in the GR_ GR_LABEL_CLASSES_B table.
UPDATE gr_label_classes_b
SET form_block = l_form_block,
last_updated_by = fnd_global.user_id,
last_update_date = sysdate,
last_update_login = l_last_update_login
WHERE label_class_code = p_field_name_class;
UPDATE GR_LABEL_CLASSES_TL
SET label_class_description = p_description,
source_lang = p_source_language,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE label_class_code = p_field_name_class
and language = p_language;
l_allow_create_update := p_label_class_resp_tab(i).allow_create_update;
-- The non-null values for display sequence and allow edit will be updated in the GR_LABEL_CLASS_RESPS table.
IF l_responsibility_id is NOT NULL then
update gr_label_class_resps
set display_sequence = l_display_sequence,
allow_create_update = l_allow_create_update
where label_class_code = p_field_name_class
and application_id = l_application_id
and responsibility_id = l_responsibility_id;
ELSE -- action is D (delete)
-- Validate that the value of Field Name class exists in the table GR_LABEL_CLASSES_B.
-- If it does not, write an error to the log file
OPEN c_get_label_class;
gr_label_classes_tl_pkg.delete_rows
(p_commit => 'T',
p_called_by_form => 'F',
p_label_class_code => p_field_name_class,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
DELETE FROM gr_label_class_resps
WHERE label_class_code = p_field_name_class;
DELETE FROM gr_label_classes_b
WHERE label_class_code = p_field_name_class;
delete from GR_LABEL_CLASSES_TL
WHERE label_class_code = p_field_name_class
and language = p_language;
l_allow_create_update := p_label_class_resp_tab(i).allow_create_update;
-- Delete the record in GR_ GR_LABEL_CLASS_RESPS
-- table for the specified field name class and responsibility id.
IF l_responsibility_id is NOT NULL then
delete from gr_label_class_resps
where label_class_code = p_field_name_class
and application_id = l_application_id
and responsibility_id = l_responsibility_id ;