The following lines contain the word 'select', 'insert', 'update' or 'delete':
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_safety_phrases_TL
WHERE safety_phrase_code = p_phrase_code);
SELECT count (language_code)
FROM fnd_languages
WHERE installed_flag IN ('I', 'B')
AND language_code not in
(SELECT language
FROM gr_risk_phrases_TL
WHERE risk_phrase_code = p_phrase_code);
SELECT safety_phrase_code
FROM gr_safety_phrases_b
WHERE safety_phrase_code = p_phrase_code;
SELECT 1
FROM gr_safety_phrases_TL
WHERE safety_phrase_code = p_phrase_code
AND language = p_language;
SELECT risk_phrase_code
FROM gr_risk_phrases_b
WHERE risk_phrase_code = p_phrase_code;
SELECT 1
FROM gr_risk_phrases_TL
WHERE risk_phrase_code = p_phrase_code
AND language = p_language;
gr_safety_phrases_b_pkg.Insert_Row
(p_commit => 'T',
p_called_by_form => 'F',
p_safety_phrase_code => p_phrase_code,
p_additional_text_type => 'N',
p_lookup_type => NULL ,
p_lookup_code => NULL ,
p_attribute_category => p_attribute_category ,
p_attribute1 => p_attribute1 ,
p_attribute2 => p_attribute2 ,
p_attribute3 => p_attribute3 ,
p_attribute4 => p_attribute4 ,
p_attribute5 => p_attribute5 ,
p_attribute6 => p_attribute6 ,
p_attribute7 => p_attribute7 ,
p_attribute8 => p_attribute8 ,
p_attribute9 => p_attribute9 ,
p_attribute10 => p_attribute10 ,
p_attribute11 => p_attribute11 ,
p_attribute12 => p_attribute12 ,
p_attribute13 => p_attribute13 ,
p_attribute14 => p_attribute14 ,
p_attribute15 => p_attribute15 ,
p_attribute16 => p_attribute16 ,
p_attribute17 => p_attribute17 ,
p_attribute18 => p_attribute18 ,
p_attribute19 => p_attribute19 ,
p_attribute20 => p_attribute20 ,
p_attribute21 => p_attribute21 ,
p_attribute22 => p_attribute22 ,
p_attribute23 => p_attribute23 ,
p_attribute24 => p_attribute24 ,
p_attribute25 => p_attribute25 ,
p_attribute26 => p_attribute26 ,
p_attribute27 => p_attribute27 ,
p_attribute28 => p_attribute28 ,
p_attribute29 => p_attribute29 ,
p_attribute30 => p_attribute30 ,
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_safety_phrases_tl_pkg.insert_row(p_commit => 'T',
p_called_by_form => 'F',
p_safety_phrase_code => p_phrase_code,
p_language => p_language,
p_source_language => p_source_language,
p_safety_phrase_description => p_phrase_text,
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_safety_phrases_tl_pkg.insert_row(p_commit => 'T',
p_called_by_form => 'F',
p_safety_phrase_code => p_phrase_code,
p_language => p_language,
p_source_language => p_source_language,
p_safety_phrase_description => p_phrase_text,
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_risk_phrases_b_pkg.Insert_Row
(p_commit => 'T',
p_called_by_form => 'F',
p_risk_phrase_code => p_phrase_code,
p_additional_text_indicator => 'N',
p_lookup_type => NULL ,
p_lookup_code => NULL ,
p_attribute_category => p_attribute_category ,
p_attribute1 => p_attribute1 ,
p_attribute2 => p_attribute2 ,
p_attribute3 => p_attribute3 ,
p_attribute4 => p_attribute4 ,
p_attribute5 => p_attribute5 ,
p_attribute6 => p_attribute6 ,
p_attribute7 => p_attribute7 ,
p_attribute8 => p_attribute8 ,
p_attribute9 => p_attribute9 ,
p_attribute10 => p_attribute10 ,
p_attribute11 => p_attribute11 ,
p_attribute12 => p_attribute12 ,
p_attribute13 => p_attribute13 ,
p_attribute14 => p_attribute14 ,
p_attribute15 => p_attribute15 ,
p_attribute16 => p_attribute16 ,
p_attribute17 => p_attribute17 ,
p_attribute18 => p_attribute18 ,
p_attribute19 => p_attribute19 ,
p_attribute20 => p_attribute20 ,
p_attribute21 => p_attribute21 ,
p_attribute22 => p_attribute22 ,
p_attribute23 => p_attribute23 ,
p_attribute24 => p_attribute24 ,
p_attribute25 => p_attribute25 ,
p_attribute26 => p_attribute26 ,
p_attribute27 => p_attribute27 ,
p_attribute28 => p_attribute28 ,
p_attribute29 => p_attribute29 ,
p_attribute30 => p_attribute30 ,
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_risk_phrases_tl_pkg.insert_row(p_commit => 'T',
p_called_by_form => 'F',
p_risk_phrase_code => p_phrase_code,
p_language => p_language,
p_source_language => p_source_language,
p_risk_description => p_phrase_text,
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_risk_phrases_tl_pkg.insert_row(p_commit => 'T',
p_called_by_form => 'F',
p_risk_phrase_code => p_phrase_code,
p_language => p_language,
p_source_language => p_source_language,
p_risk_description => p_phrase_text,
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);
UPDATE GR_SAFETY_PHRASES_B
SET attribute_category = p_attribute_category ,
attribute1 = p_attribute1 ,
attribute2 = p_attribute2 ,
attribute3 = p_attribute3 ,
attribute4 = p_attribute4 ,
attribute5 = p_attribute5 ,
attribute6 = p_attribute6 ,
attribute7 = p_attribute7 ,
attribute8 = p_attribute8 ,
attribute9 = p_attribute9 ,
attribute10 = p_attribute10 ,
attribute11 = p_attribute11 ,
attribute12 = p_attribute12 ,
attribute13 = p_attribute13 ,
attribute14 = p_attribute14 ,
attribute15 = p_attribute15 ,
attribute16 = p_attribute16 ,
attribute17 = p_attribute17 ,
attribute18 = p_attribute18 ,
attribute19 = p_attribute19 ,
attribute20 = p_attribute20 ,
attribute21 = p_attribute21 ,
attribute22 = p_attribute22 ,
attribute23 = p_attribute23 ,
attribute24 = p_attribute24 ,
attribute25 = p_attribute25 ,
attribute26 = p_attribute26 ,
attribute27 = p_attribute27 ,
attribute28 = p_attribute28 ,
attribute29 = p_attribute29 ,
attribute30 = p_attribute30 ,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE safety_phrase_code = p_phrase_code;
UPDATE GR_SAFETY_PHRASES_TL
SET safety_phrase_description = p_phrase_text,
source_lang = p_source_language,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE safety_phrase_code = p_phrase_code
AND language = p_language;
UPDATE GR_RISK_PHRASES_B
SET attribute_category = p_attribute_category ,
attribute1 = p_attribute1 ,
attribute2 = p_attribute2 ,
attribute3 = p_attribute3 ,
attribute4 = p_attribute4 ,
attribute5 = p_attribute5 ,
attribute6 = p_attribute6 ,
attribute7 = p_attribute7 ,
attribute8 = p_attribute8 ,
attribute9 = p_attribute9 ,
attribute10 = p_attribute10 ,
attribute11 = p_attribute11 ,
attribute12 = p_attribute12 ,
attribute13 = p_attribute13 ,
attribute14 = p_attribute14 ,
attribute15 = p_attribute15 ,
attribute16 = p_attribute16 ,
attribute17 = p_attribute17 ,
attribute18 = p_attribute18 ,
attribute19 = p_attribute19 ,
attribute20 = p_attribute20 ,
attribute21 = p_attribute21 ,
attribute22 = p_attribute22 ,
attribute23 = p_attribute23 ,
attribute24 = p_attribute24 ,
attribute25 = p_attribute25 ,
attribute26 = p_attribute26 ,
attribute27 = p_attribute27 ,
attribute28 = p_attribute28 ,
attribute29 = p_attribute29 ,
attribute30 = p_attribute30 ,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE risk_phrase_code = p_phrase_code;
UPDATE GR_RISK_PHRASES_TL
SET risk_description = p_phrase_text,
source_lang = p_source_language,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = SYSDATE,
last_update_login = l_last_update_login
WHERE risk_phrase_code = p_phrase_code
AND language = p_language;
ELSE -- action is D (delete)
IF p_phrase_type = 'S' THEN
OPEN c_get_safety_phrase_code;
DELETE FROM gr_safety_phrases_tl
WHERE safety_phrase_code = p_phrase_code;
DELETE FROM gr_safety_phrases_b
WHERE safety_phrase_code = p_phrase_code;
DELETE gr_safety_phrases_tl
WHERE safety_phrase_code = p_phrase_code
and language = p_language;
DELETE FROM gr_risk_phrases_tl
WHERE risk_phrase_code = p_phrase_code;
DELETE FROM gr_risk_phrases_b
WHERE risk_phrase_code = p_phrase_code;
DELETE gr_risk_phrases_tl
WHERE risk_phrase_code = p_phrase_code
and language = p_language;