The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_x_line_tbl(1).operation := 'UPDATE';
l_x_line_tbl(K).operation := 'UPDATE';
l_x_line_tbl.delete; -- clear out the table for every order
l_x_old_line_tbl.delete;
l_x_line_tbl.delete;
l_x_old_line_tbl.delete;
l_x_line_tbl.delete;
l_x_old_line_tbl.delete;
l_x_line_tbl.delete;
l_x_old_line_tbl.delete;
SELECT header_id
INTO l_header_id
FROM oe_order_lines_all
WHERE line_id = l_line_id;
(p_selected_line_tbl IN OE_GLOBALS.selected_record_tbl, -- R12.MOAC
p_reservation_mode IN VARCHAR2 DEFAULT NULL,
p_percent IN NUMBER DEFAULT NULL,
p_reserve_run_type IN VARCHAR2,
p_reservation_set_Name IN VARCHAR2 DEFAULT NULL,
p_override_set IN VARCHAR2 DEFAULT 'N',
p_order_by IN VARCHAR2 DEFAULT NULL,
p_partial_preference IN VARCHAR2 DEFAULT 'N')
RETURN NUMBER
IS
l_request_id NUMBER;
IF p_selected_line_tbl.COUNT > 0 THEN
SELECT oe_reservation_sets_s.nextval
INTO l_set_id
FROM dual;
FOR I IN 1..p_selected_line_tbl.COUNT LOOP
IF l_debug_level > 0 THEN
oe_debug_pub.add( ' Line Id '||p_selected_line_tbl(I).id1,1);
INSERT INTO oe_rsv_set_details
(reservation_set_id
,line_id
,header_id
,creation_date
,created_by
,last_update_date
,last_updated_by
,last_update_login
,line_sequence
)
VALUES
(-l_set_id
,p_selected_line_tbl(I).id1
,0
,sysdate
,FND_GLOBAL.USER_ID
,sysdate
,FND_GLOBAL.USER_ID
,FND_GLOBAL.LOGIN_ID
,I --10241113
);
-l_set_id, --p_selected_ids -- R12.MOAC
NULL, --Dummy Parameter
p_partial_preference); --p_partial_preference
PROCEDURE : Update_Reservation_Qty
DESCRIPTION : Will update the corrected qty of the lines of reservation set
------------------------------------------------------------------*/
PROCEDURE Update_Reservation_Qty
(p_reservation_set IN VARCHAR2,
p_sch_line_tbl IN OE_SCH_ORGANIZER_UTIL.sch_line_tbl_type)
IS
CURSOR rsv_set_id IS
SELECT reservation_set_id
FROM oe_reservation_sets
WHERE Reservation_set_name =p_reservation_set;
oe_debug_pub.add( 'IN UPDATE_RESERVATION_QTY FOR SET:'||l_set_id ) ;
Update Oe_Rsv_Set_Details
SET Corrected_Qty = p_sch_line_tbl(I).corrected_qty,
Corrected_Qty2 = p_sch_line_tbl(I).corrected_qty2, -- INVCONV
last_update_login = FND_GLOBAL.LOGIN_ID,
last_updated_by = FND_GLOBAL.USER_ID,
last_update_date = sysdate
WHERE Reservation_set_id = l_set_id
AND Line_Id = p_sch_line_tbl(I).line_id;
oe_debug_pub.add( 'EXITING UPDATE_RESERVATION_QTY' ) ;
END Update_Reservation_Qty;
SELECT process_flag
FROM oe_reservation_sets
WHERE reservation_set_name = p_reservation_set_name;
PROCEDURE Insert_into_tmp_tab(p_line_id IN NUMBER)
IS
BEGIN
INSERT INTO OE_SCH_ID_LIST_TMP(line_id)
VALUES(p_line_id);
END Insert_into_tmp_tab;
PROCEDURE Insert_into_tmp_tab(p_line_tbl IN OE_GLOBALS.Selected_Record_Tbl)
IS
BEGIN
FOR I IN 1..p_line_tbl.COUNT LOOP
INSERT INTO OE_SCH_ID_LIST_TMP(line_id)
VALUES(p_line_tbl(I).id1);
END Insert_into_tmp_tab;
PROCEDURE delete_tmp_tab
IS
BEGIN
DELETE FROM OE_SCH_ID_LIST_TMP;
END delete_tmp_tab;
(p_selected_line_tbl IN OE_GLOBALS.Selected_Record_Tbl,
p_sch_action IN VARCHAR2,
x_atp_tbl OUT NOCOPY oe_atp.atp_tbl_type,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg OUT NOCOPY VARCHAR2)
IS
l NUMBER;
l_selected_tbl OE_GLOBALS.Selected_Record_Tbl;
l_count := p_selected_line_tbl.count;
oe_debug_pub.add( 'Lines selected '||l_count , 1 ) ;
FOR I IN 1..p_selected_line_tbl.count Loop
/* in the selected table of records, id1 is line_id and id2 is header_id */
IF NOT p_processed_table.exists(p_selected_line_tbl(I).id2) THEN
--p_processed_table(p_selected_line_tbl(I).id2) :='Y';
p_processed_table(p_selected_line_tbl(I).id2) :=p_selected_line_tbl(I).id2;
l_selected_tbl(1).id1 := p_selected_line_tbl(I).id1;
insert_into_tmp_tab(p_selected_line_tbl(I).id1);
l_org_id <> p_selected_line_tbl(I).org_id THEN
l_org_id := p_selected_line_tbl(I).org_id;
IF p_selected_line_tbl(J).id2 = p_selected_line_tbl (I).id2 THEN
l_selected_tbl(K).id1 := p_selected_line_tbl(J).id1;
insert_into_tmp_tab(p_selected_line_tbl(J).id1);
(p_selected_line_tbl => l_selected_tbl,
p_line_count => l_selected_tbl.count,
p_sch_action => p_sch_action,
x_atp_tbl => l_atp_tbl,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
l_selected_tbl.DELETE;
l_selected_tbl(1).id1 := p_selected_line_tbl(1).id1;
insert_into_tmp_tab(p_selected_line_tbl(1).id1);
l_org_id <> p_selected_line_tbl(1).org_id THEN
l_org_id := p_selected_line_tbl(1).org_id;
(p_selected_line_tbl => l_selected_tbl,
p_line_count => l_selected_tbl.count,
p_sch_action => p_sch_action,
x_atp_tbl => l_atp_tbl,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);