The following lines contain the word 'select', 'insert', 'update' or 'delete':
* Updated By For *
* Peter Lowe 02/04/09 8208515 *
* *
*****************************************************************
*/
-- Global variables
G_PKG_NAME CONSTANT VARCHAR2(30):='GR_FIELD_NAME_PROPERTIES_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 count (language_code)
FROM fnd_languages
WHERE installed_flag IN ('I', 'B')
AND language_code not in
(SELECT language
FROM GR_PROPERTIES_TL
WHERE PROPERTY_ID = p_PROPERTY_ID);
SELECT 1
FROM
GR_PROPERTIES_B B
where B.PROPERTY_ID = p_property_id;
SELECT 1
FROM
GR_PROPERTIES_B B
where B.PROPERTY_ID = p_property_id
and property_type_indicator = 'F';
SELECT 1
FROM gr_properties_tl prt
WHERE prt.property_id = p_property_id
AND prt.language = p_language;
GR_PROPERTIES_B_PKG.Insert_Row
(p_commit => 'F',
p_called_by_form => 'F',
p_property_id => p_property_id,
p_property_type_indicator => p_property_type_indicator,
p_length => p_length,
p_precision => p_precision,
p_range_min => p_range_min,
p_range_max => p_range_max,
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_properties_tl_pkg.insert_row(
p_commit => 'F',
p_called_by_form => 'F',
p_property_id => p_property_id,
p_language => p_language,
p_source_lang => p_source_language,
p_description => p_description,
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 all associated property values into the GR_PROPERTY_VALUES_TL table
FOR i IN 1 .. p_label_prop_values_tab.count LOOP
l_display_order := p_label_prop_values_tab(i).display_order;
gr_property_values_tl_pkg.Insert_Row
(p_commit => 'F',
p_called_by_form => 'F',
p_property_id => p_property_id,
p_language => p_language,
p_value => l_value,
p_display_order=> l_display_order,
p_source_lang => p_source_language,
p_meaning => l_value_description,
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_properties_tl_pkg.insert_row(
p_commit => 'F',
p_called_by_form => 'F',
p_property_id => p_property_id,
p_language => p_language,
p_source_lang => p_source_language,
p_description => p_description,
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_property_values_tl_pkg.Insert_Row
(p_commit => 'F',
p_called_by_form => 'F',
p_property_id => p_property_id,
p_language => p_language,
p_value => l_value,
p_display_order=> l_display_order,
p_source_lang => p_source_language,
p_meaning => l_value_description,
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);
-- length, decimal precision, minimum value and maximum value will be updated in the GR_PROPERTIES_B table.
UPDATE GR_PROPERTIES_B
SET length = nvl(p_length,length),
precision = nvl(p_precision,precision),
range_min = nvl(p_range_min,range_min),
range_max = nvl(p_range_max,range_max),
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE property_id = l_property_id;
-- The value for Property Description will be updated GR_PROPERTIES_TL table for the specified language.
UPDATE GR_PROPERTIES_TL
SET description = p_description,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE property_id = p_property_id
and language = p_language;
UPDATE GR_PROPERTY_values_TL
SET meaning = l_value_description,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE property_id = p_property_id
and language = p_language
and value = l_value;
ELSE -- action is D (delete)
-- Validate that the value of Property Id exists in the table GR_PROPERTIES_B.
-- If it does not, an error message will be written to the log file.
dummy:= 0;
delete from GR_PROPERTY_VALUES_TL T
where t.PROPERTY_ID = p_PROPERTY_ID;
delete from GR_PROPERTIES_TL T
where t.PROPERTY_ID = p_PROPERTY_ID;
DELETE FROM GR_PROPERTIES_B
where PROPERTY_ID = p_PROPERTY_ID;
delete from GR_PROPERTIES_TL
WHERE property_id = p_property_id
and language = p_language;
-- Delete the record in GR_PROPERTY_VALUES_TL table for the specified language. .
IF l_value is NOT NULL then
delete from GR_PROPERTY_values_TL
WHERE property_id = p_property_id
and language = p_language
and value = l_value;