The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Insert_Row
(p_commit IN VARCHAR2,
p_called_by_form IN VARCHAR2,
p_item_code IN VARCHAR2,
p_safety_phrase_code IN VARCHAR2,
p_temperature IN NUMBER,
p_temperature_scale IN VARCHAR2,
p_created_by IN NUMBER,
p_creation_date IN DATE,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_phrase_code IN VARCHAR2,
x_rowid OUT NOCOPY VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
SAVEPOINT Insert_Row;
p_last_update_date,
p_last_updated_by,
p_last_update_login,
p_phrase_code,
l_return_status,
l_oracle_error,
l_msg_data);
INSERT INTO gr_item_safety_phrases
(item_code,
safety_phrase_code,
temperature,
temperature_scale,
created_by,
creation_date,
last_update_date,
last_updated_by,
last_update_login,
phrase_code)
VALUES
(p_item_code,
p_safety_phrase_code,
p_temperature,
p_temperature_scale,
p_created_by,
p_creation_date,
p_last_update_date,
p_last_updated_by,
p_last_update_login,
p_phrase_code);
/* Now get the row id of the inserted record */
Check_Primary_Key
(p_item_code,
p_safety_phrase_code,
'F',
l_rowid,
l_key_exists);
ROLLBACK TO SAVEPOINT Insert_Row;
ROLLBACK TO SAVEPOINT Insert_Row;
ROLLBACK TO SAVEPOINT Insert_Row;
'GR_NO_RECORD_INSERTED');
ROLLBACK TO SAVEPOINT Insert_Row;
END Insert_Row;
PROCEDURE Update_Row
(p_commit IN VARCHAR2,
p_called_by_form IN VARCHAR2,
p_rowid IN VARCHAR2,
p_item_code IN VARCHAR2,
p_safety_phrase_code IN VARCHAR2,
p_temperature IN NUMBER,
p_temperature_scale IN VARCHAR2,
p_created_by IN NUMBER,
p_creation_date IN DATE,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_phrase_code IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
SAVEPOINT Update_Row;
p_last_update_date,
p_last_updated_by,
p_last_update_login,
p_phrase_code,
l_return_status,
l_oracle_error,
l_msg_data);
UPDATE gr_item_safety_phrases
SET item_code = p_item_code,
safety_phrase_code = p_safety_phrase_code,
temperature = p_temperature,
temperature_scale = p_temperature_scale,
created_by = p_created_by,
creation_date = p_creation_date,
last_update_date = p_last_update_date,
last_updated_by = p_last_updated_by,
last_update_login = p_last_update_login,
phrase_code = p_phrase_code
WHERE rowid = p_rowid;
ROLLBACK TO SAVEPOINT Update_Row;
ROLLBACK TO SAVEPOINT Update_Row;
'GR_NO_RECORD_INSERTED');
ROLLBACK TO SAVEPOINT Update_Row;
END Update_Row;
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_phrase_code IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
SELECT *
FROM gr_item_safety_phrases
WHERE rowid = p_rowid
FOR UPDATE NOWAIT;
PROCEDURE Delete_Row
(p_commit IN VARCHAR2,
p_called_by_form IN VARCHAR2,
p_rowid IN VARCHAR2,
p_item_code IN VARCHAR2,
p_safety_phrase_code IN VARCHAR2,
p_temperature IN NUMBER,
p_temperature_scale IN VARCHAR2,
p_created_by IN NUMBER,
p_creation_date IN DATE,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_phrase_code IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
SAVEPOINT Delete_Row;
p_last_update_date,
p_last_updated_by,
p_last_update_login,
p_phrase_code,
l_return_status,
l_oracle_error,
l_msg_data);
DELETE FROM gr_item_safety_phrases
WHERE rowid = p_rowid;
ROLLBACK TO SAVEPOINT Delete_Row;
ROLLBACK TO SAVEPOINT Delete_Row;
ROLLBACK TO SAVEPOINT Delete_Row;
END Delete_Row;
PROCEDURE Delete_Rows
(p_commit IN VARCHAR2,
p_called_by_form IN VARCHAR2,
p_delete_option IN VARCHAR2,
p_item_code IN VARCHAR2,
p_safety_phrase_code IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
NULL_DELETE_OPTION_ERROR EXCEPTION;
SAVEPOINT Delete_Rows;
** p delete option has one of two values
** 'I' - Delete all rows for the specified item.
** 'S' - Delete all rows for the specified safety phrase.
*/
IF p_delete_option = 'I' THEN
IF p_item_code IS NULL THEN
l_msg_token := 'Item Code';
RAISE Null_Delete_Option_Error;
DELETE FROM gr_item_safety_phrases
WHERE item_code = p_item_code;
ELSIF p_delete_option = 'S' THEN
IF p_safety_phrase_code IS NULL THEN
l_msg_token := 'Safety Phrase Code';
RAISE Null_Delete_Option_Error;
DELETE FROM gr_item_safety_phrases
WHERE safety_phrase_code = p_safety_phrase_code;
WHEN Null_Delete_Option_Error THEN
x_return_status := 'E';
ROLLBACK TO SAVEPOINT Delete_Rows;
END Delete_Rows;
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_phrase_code IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
p_phrase_code IN VARCHAR2,
x_return_status OUT NOCOPY VARCHAR2,
x_oracle_error OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2)
IS
/* Alpha Variables */
L_RETURN_STATUS VARCHAR2(1) := 'S';
SELECT isp.rowid
FROM gr_item_safety_phrases isp
WHERE isp.item_code = p_item_code
AND isp.safety_phrase_code = p_safety_phrase_code;