The following lines contain the word 'select', 'insert', 'update' or 'delete':
Function : This package contains public procedures used to create, modify, and delete operation activties
Pre-reqs : N/A
Parameters: Per function
Current Vers : 1.0
Previous Vers : 1.0
Initial Vers : 1.0
Notes
*/
--Bug 3222090, NSRIVAST 20-FEB-2004, BEGIN
--Forward declaration.
FUNCTION set_debug_flag RETURN VARCHAR2;
insert_operation_activity
Description
This particular procedure is used to insert an
operation activity Parameters
================================================ */
PROCEDURE insert_operation_activity
( p_api_version IN NUMBER
, p_init_msg_list IN BOOLEAN
, p_commit IN BOOLEAN
, p_oprn_no IN gmd_operations.oprn_no%TYPE
, p_oprn_vers IN gmd_operations.oprn_vers%TYPE
, p_oprn_activity IN OUT NOCOPY gmd_operation_activities%ROWTYPE
, p_oprn_rsrc_tbl IN gmd_operation_resources_pub.gmd_oprn_resources_tbl_type
, x_message_count OUT NOCOPY NUMBER
, x_message_list OUT NOCOPY VARCHAR2
, x_return_status OUT NOCOPY VARCHAR2) IS
v_activity gmd_operation_activities.activity%TYPE;
SELECT 1
FROM gmd_operations_b
WHERE oprn_id = p_oprn_id
AND delete_mark = 0;
SELECT oprn_id
FROM gmd_operations_b
WHERE oprn_No = p_oprn_no
AND oprn_vers = p_oprn_vers
and delete_Mark = 0;
SELECT 1
FROM gmd_activities
WHERE activity = v_activity
and delete_mark = 0;
SELECT GEM5_OPRNLINE_ID_S.NEXTVAL
FROM FND_DUAL;
SAVEPOINT insert_oprn_actv;
gmd_debug.put_line('In insert_operation_activity public.');
,'insert_operation_activity'
,'gmd_operation_activities_pub') THEN
RAISE invalid_version;
/* Validation: Check if this users performing update has access to this
operation owner orgn code */
IF NOT GMD_API_GRP.Check_orgn_access(Entity => 'OPERATION'
,Entity_id => v_oprn_id) THEN
RAISE ins_oprn_actv_err;
gmd_debug.put_line('before PVT insert_oprn_activity routine called');
/* call insert operation activity routine using oprn_id */
GMD_OPERATION_ACTIVITIES_PVT.insert_operation_activity(
p_oprn_id => v_oprn_id,
p_oprn_activity => p_oprn_activity,
x_message_count => x_message_count,
x_message_list => x_message_list,
x_return_status => l_retn_status);
/* call insert operation resources */
GMD_OPERATION_RESOURCES_PUB.insert_operation_resources(
p_init_msg_list => FALSE,
p_oprn_line_id => p_oprn_activity.oprn_line_id,
p_oprn_rsrc_tbl => p_oprn_rsrc_tbl,
x_message_count => x_message_count,
x_message_list => x_message_list,
x_return_status => l_retn_status);
ROLLBACK TO SAVEPOINT insert_oprn_actv;
ROLLBACK TO SAVEPOINT insert_oprn_actv;
ROLLBACK TO SAVEPOINT insert_oprn_actv;
END insert_operation_activity;
update_operation_activity
Description
This particular procedure is used to update
an operation activity Parameters
================================================ */
PROCEDURE update_operation_activity
( p_api_version IN NUMBER
, p_init_msg_list IN BOOLEAN
, p_commit IN BOOLEAN
, p_oprn_line_id IN gmd_operation_activities.oprn_line_id%TYPE
, p_update_table IN gmd_operation_activities_pub.update_tbl_type
, x_message_count OUT NOCOPY NUMBER
, x_message_list OUT NOCOPY VARCHAR2
, x_return_status OUT NOCOPY VARCHAR2) IS
v_oprn_id gmd_operations.oprn_id%TYPE;
SELECT oprn_id
FROM gmd_operation_activities
WHERE oprn_line_id = p_oprn_line_id
AND delete_mark = 0;
,'update_operation_activity'
,'gmd_operation_activities_pub') THEN
RAISE invalid_version;
gmd_debug.put_line('Start of update_operation_activity PUB');
/* Loop thru cols to be updated - verify col and value are present */
FOR i in 1 .. p_update_table.count LOOP
/* Col_to_update and value must be passed, otherwise give error */
IF p_update_table(i).p_col_to_update IS NULL THEN
IF (l_debug = 'Y') THEN
gmd_debug.put_line('col_to_update required');
FND_MESSAGE.SET_TOKEN ('MISSING', 'COL_TO_UPDATE');
ELSIF p_update_table(i).p_value IS NULL THEN
IF (l_debug = 'Y') THEN
gmd_debug.put_line('value required');
and Operation is not logically deleted */
OPEN get_oprn_id(p_oprn_line_id);
/* Validation: Check if this users performing update has access to this
operation owner orgn code */
IF NOT GMD_API_GRP.Check_orgn_access(Entity => 'OPERATION'
,Entity_id => v_oprn_id) THEN
RAISE upd_oprn_actv_err;
IF NOT GMD_COMMON_VAL.UPDATE_ALLOWED(Entity => 'OPERATION',
Entity_id => v_oprn_id ) THEN
FND_MESSAGE.SET_NAME('GMD', 'GMD_OPRN_NOT_VALID');
/* delete_mark validation */
FOR a IN 1 .. p_update_table.count LOOP
/* check activity factor has a value else default */
IF (UPPER(p_update_table(a).p_col_to_update) = 'ACTIVITY_FACTOR' AND
p_update_table(a).p_value < 0) THEN
gmd_api_grp.log_message ('GMD_NEGATIVE_FIELDS',
'FIELD', p_update_table(a).p_col_to_update);
ELSIF (UPPER(p_update_table(a).p_col_to_update) = 'OFFSET_INTERVAL' AND
p_update_table(a).p_value < 0) THEN
gmd_api_grp.log_message ('GMD_NEGATIVE_FIELDS',
'FIELD', p_update_table(a).p_col_to_update);
ELSIF (UPPER(p_update_table(a).p_col_to_update) = 'SEQUENCE_DEPENDENT_IND' AND
p_update_table(a).p_value NOT IN (1,0)) THEN
FND_MESSAGE.SET_NAME('GMD','GMD_INVALID_SEQ_DEP_IND');
GMD_OPERATION_ACTIVITIES_PVT.update_operation_activity(p_oprn_line_id => p_oprn_line_id
, p_update_table => p_update_table
, x_message_count => x_message_count
, x_message_list => x_message_list
, x_return_status => l_retn_status);
END update_operation_activity;
delete_operation_activity
Description
This particular procedure is used to delete an
operation activity Parameters
================================================ */
PROCEDURE delete_operation_activity
( p_api_version IN NUMBER
, p_init_msg_list IN BOOLEAN
, p_commit IN BOOLEAN
, p_oprn_line_id IN gmd_operation_activities.oprn_line_id%TYPE
, x_message_count OUT NOCOPY NUMBER
, x_message_list OUT NOCOPY VARCHAR2
, x_return_status OUT NOCOPY VARCHAR2) IS
v_update_table gmd_operation_activities_pub.update_tbl_type;
SELECT oprn_id
FROM gmd_operation_activities
WHERE oprn_line_id = v_oprn_line_id;
SELECT COUNT(1)
FROM gmd_operation_activities a
WHERE a.oprn_id = v_oprn_id;
SAVEPOINT delete_oprn_actv;
,'delete_operation_activity'
,'gmd_operation_activities_pvt') THEN
RAISE invalid_version;
gmd_debug.put_line('START of delete_operation_activity PUB');
/* Validation: Check if this users performing update has access to this
operation owner orgn code */
IF NOT GMD_API_GRP.Check_orgn_access(Entity => 'OPERATION'
,Entity_id => l_oprn_id) THEN
RAISE del_oprn_actv_err;
gmd_operation_activities_pvt.delete_operation_activity
(p_oprn_line_id => p_oprn_line_id
, x_message_count => x_message_count
, x_message_list => x_message_list
, x_return_status => l_retn_status);
ROLLBACK TO SAVEPOINT delete_oprn_actv;
ROLLBACK TO SAVEPOINT delete_oprn_actv;
ROLLBACK TO SAVEPOINT delete_oprn_actv;
END delete_operation_activity;