The following lines contain the word 'select', 'insert', 'update' or 'delete':
g_old_resource_id NUMBER; -- variable containing old resource_id; populated in Pre_Update hook
PROCEDURE Insert_MTL_Unit_Trans(
p_resource_id NUMBER,
p_transaction_id NUMBER,
p_inventory_item_id NUMBER,
p_organization_id NUMBER,
p_subinventory_code VARCHAR2
)
IS
CURSOR c_mtl_unit_trans(b_transaction_id NUMBER
,b_inventory_item_id NUMBER
,b_organization_id NUMBER
,b_subinventory_code VARCHAR2)
IS
SELECT TRANSACTION_ID, SERIAL_NUMBER
FROM MTL_UNIT_TRANSACTIONS
WHERE TRANSACTION_ID = b_transaction_id
AND INVENTORY_ITEM_ID = b_inventory_item_id
AND ORGANIZATION_ID = b_organization_id
AND SUBINVENTORY_CODE = b_subinventory_code;
, v_message => 'Entering Insert_MTL_Unit_Trans'
, v_level_id => JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_FULL);
, v_message => 'Insert_MTL_Unit_Trans could not find records for transaction :' || p_transaction_id ||
' , ' || p_inventory_item_id || p_organization_id ||
' , ' || p_subinventory_code || ' for resource id ' || p_resource_id
, v_level_id => JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_MEDIUM);
, v_message => 'Inserting ACC record :' || p_transaction_id ||
' , ' || p_inventory_item_id || p_organization_id ||
' , ' || p_subinventory_code || ' for resource id ' || p_resource_id
, v_level_id => JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_FULL);
/*** Call common package to insert record into ACC table ***/
JTM_HOOK_UTIL_PKG.Insert_Acc
( p_publication_item_names => g_publication_item_name
,p_acc_table_name => g_acc_table_name
,p_resource_id => p_resource_id
,p_pk1_name => g_pk1_name
,p_pk1_num_value => r_mtl_unit_trans.TRANSACTION_ID
,p_pk2_name => g_pk2_name
,p_pk2_char_value => r_mtl_unit_trans.SERIAL_NUMBER
);
END Insert_MTL_Unit_Trans;
PROCEDURE Update_MTL_Unit_Trans(
p_resource_id NUMBER,
p_transaction_id NUMBER,
p_inventory_item_id NUMBER,
p_organization_id NUMBER,
p_subinventory_code VARCHAR2
)
IS
BEGIN
/*** Not necassery because it will be an insert or delete updates will not be done from the csp_inv_loc_ass package ***/
/*** get debug level ***/
g_debug_level := JTM_HOOK_UTIL_PKG.Get_Debug_Level;
END Update_MTL_Unit_Trans;
PROCEDURE Delete_MTL_Unit_Trans(
p_resource_id NUMBER,
p_transaction_id NUMBER,
p_inventory_item_id NUMBER,
p_organization_id NUMBER,
p_subinventory_code VARCHAR2
)
IS
CURSOR c_mtl_unit_trans(b_transaction_id NUMBER
,b_inventory_item_id NUMBER
,b_organization_id NUMBER
,b_subinventory_code VARCHAR2)
IS
SELECT TRANSACTION_ID, SERIAL_NUMBER
FROM MTL_UNIT_TRANSACTIONS
WHERE TRANSACTION_ID = b_transaction_id
AND INVENTORY_ITEM_ID = b_inventory_item_id
AND ORGANIZATION_ID = b_organization_id
AND SUBINVENTORY_CODE = b_subinventory_code;
, v_message => 'Entering Delete_MTL_trans_lot_num'
, v_level_id => JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_FULL);
, v_message => 'Delete_MTL_trans_lot_num could not find transaction records for transaction :' || p_transaction_id ||
' , ' || p_inventory_item_id || p_organization_id ||
' , ' || p_subinventory_code || ' for resource id ' || p_resource_id
, v_level_id => JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_MEDIUM);
/*** Call common package to insert record into ACC table ***/
JTM_HOOK_UTIL_PKG.Delete_Acc
( p_publication_item_names => g_publication_item_name
,p_acc_table_name => g_acc_table_name
,p_resource_id => p_resource_id
,p_pk1_name => g_pk1_name
,p_pk1_num_value => r_mtl_unit_trans.TRANSACTION_ID
,p_pk2_name => g_pk2_name
,p_pk2_char_value => r_mtl_unit_trans.SERIAL_NUMBER
);
END Delete_MTL_Unit_Trans;
/*Delete all records for non-existing user ( e.g user was deleted )*/
PROCEDURE DELETE_ALL_ACC_RECORDS( p_resource_id IN NUMBER
, x_return_status OUT NOCOPY VARCHAR2 )
IS
BEGIN
/*** get debug level ***/
g_debug_level := JTM_HOOK_UTIL_PKG.Get_Debug_Level;
, 'Entering DELETE_ALL_ACC_RECORDS'
, JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_FULL
);
DELETE JTM_MTL_UNIT_TRANS_ACC
WHERE RESOURCE_ID = p_resource_id;
, 'Leaving DELETE_ALL_ACC_RECORDS'
, JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_FULL
);
, v_message => 'Caught exception in DELETE_ALL_ACC_RECORDS hook:' || fnd_global.local_chr(10) || sqlerrm
, v_level_id => JTM_HOOK_UTIL_PKG.G_DEBUG_LEVEL_ERROR);
END DELETE_ALL_ACC_RECORDS;