The following lines contain the word 'select', 'insert', 'update' or 'delete':
* Updated By For *
* *
* Peter Lowe 07/10/08 Bug 7247651 *
*****************************************************************
*/
-- Global variables
G_PKG_NAME CONSTANT VARCHAR2(30):='GR_FIELD_NAMES_PUB';
l_last_update_login NUMBER(15,0) := 0;
SELECT lng.language_code
FROM fnd_languages lng
WHERE lng.language_code = l_language_code;
SELECT 1
FROM
GR_LABELS_B B
where B.LABEL_CODE = p_field_name;
SELECT count (language_code)
FROM fnd_languages
WHERE installed_flag IN ('I', 'B')
AND language_code not in
(SELECT language
FROM gr_labels_tl_v
WHERE label_code = p_field_name);
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_PROPERTIES_B B
where B.PROPERTY_ID = l_property_id;
SELECT property_type_indicator
FROM GR_PROPERTIES_B B
where B.PROPERTY_ID = l_property_id;
SELECT lp.rowid
FROM gr_label_properties lp
WHERE lp.property_id = l_property_id
AND lp.label_code = p_field_name;
-- insert row
IF p_technical_parameter_flag = 'Y' then
l_technical_parameter_flag := 1;
GR_LABELS_B_PKG.Insert_Row
(p_commit => 'F',
p_called_by_form => 'F',
p_label_code => p_field_name,
p_safety_category_code => 'NU', -- dummy default as no longer used
p_label_class_code => p_field_name_class,
p_data_position_indicator => 'I', -- dummy default as no longer used
p_label_properties_flag => l_label_properties_flag, -- Y if some input in input table
p_label_value_required => l_label_value_required, -- dummy default as no longer used
p_item_properties_flag => 'Y', -- bug 7247651 this needs to be set
p_ingredient_value_flag => 'N', -- dummy default as no longer used
p_inherit_from_label_code => NULL,
p_print_ingredient_indicator => NULL,
p_print_font => NULL,
p_print_size => l_print_size,
p_ingredient_label_code => NULL,
p_value_procedure => 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,
p_tech_parm => l_technical_parameter_flag,
p_rollup_disclosure_code => NULL,
x_rowid => row_id,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
GR_LABELS_TL_PKG.INSERT_ROW(
P_COMMIT => 'F'
,P_CALLED_BY_FORM => 'F'
,P_LABEL_CODE => p_field_name
,P_LANGUAGE => P_LANGUAGE
,P_LABEL_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 => 0
,X_ROWID => row_id
,X_RETURN_STATUS => return_status
,X_ORACLE_ERROR => oracle_error
,X_MSG_DATA => msg_data);
/* Loop through records in input table and insert into gr_label_properties table for each record*/
FOR i IN 1 .. p_label_properties_tab.count LOOP
l_property_id := p_label_properties_tab(i).property_id;
GR_LABEL_PROPERTIES_PKG.Insert_Row
(p_commit => 'F',
p_called_by_form => 'F',
p_sequence_number => p_label_properties_tab(i).sequence_number,
p_property_id => l_property_id,
p_label_code => p_field_name,
p_rollup_type => 0,
p_property_required => p_label_properties_tab(i).property_required,
p_created_by => 0,
p_creation_date => SYSDATE,
p_last_updated_by => 0,
p_last_update_date => SYSDATE,
p_last_update_login => 0,
x_rowid => row_id,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
GR_LABELS_TL_PKG.INSERT_ROW(
P_COMMIT => 'F'
,P_CALLED_BY_FORM => 'F'
,P_LABEL_CODE => p_field_name
,P_LANGUAGE => P_LANGUAGE
,P_LABEL_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 => 0
,X_ROWID => row_id
,X_RETURN_STATUS => return_status
,X_ORACLE_ERROR => oracle_error
,X_MSG_DATA => msg_data);
/* Loop through records in input table and insert into gr_label_properties table for each record*/
FOR i IN 1 .. p_label_properties_tab.count LOOP
l_property_id := p_label_properties_tab(i).property_id;
GR_LABEL_PROPERTIES_PKG.Insert_Row
(p_commit => 'F',
p_called_by_form => 'F',
p_sequence_number => p_label_properties_tab(i).sequence_number,
p_property_id => l_property_id,
p_label_code => p_field_name,
p_rollup_type => 0,
p_property_required => p_label_properties_tab(i).property_required,
p_created_by => 0,
p_creation_date => SYSDATE,
p_last_updated_by => 0,
p_last_update_date => SYSDATE,
p_last_update_login => 0,
x_rowid => row_id,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
UPDATE gr_labels_b
SET label_class_code = p_field_name_class,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE, -- pal
last_update_login = l_last_update_login,
tech_parm = l_technical_parameter_flag
WHERE label_code = p_field_name;
UPDATE gr_labels_tl
SET label_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_code = p_field_name
and language = p_language;
-- and display sequence will be updated to the GR_LABEL_PROPERTIES table
UPDATE gr_label_properties
SET sequence_number = l_sequence_number,
property_required = l_property_required,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE property_id = l_property_id
and label_code = p_field_name;
gr_labels_tl_pkg.delete_rows
(p_commit => 'F',
p_called_by_form => 'F',
p_label_code => p_field_name,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
gr_label_properties_pkg.delete_rows
(p_commit => 'F',
p_called_by_form => 'T',
p_delete_option => 'L',
p_property_id => NULL,
p_label_code => p_field_name,
x_return_status => return_status,
x_oracle_error => oracle_error,
x_msg_data => msg_data);
DELETE FROM gr_labels_b
WHERE label_code = p_field_name;
delete gr_labels_tl
WHERE label_code = p_field_name
and language = p_language;
-- Delete the record in GR_LABEL_PROPERTIES table for the specified field name and property id.
delete from gr_label_properties
WHERE property_id = l_property_id
and label_code = p_field_name;