Вызов другой процедуры с запросом вставки (тот же пакет).
Процедура 2 параметризована массивом в качестве входных данных для манипуляции
Подходы
1-exec CreateShipmentLines (p_result);
2-CreateShipmentLines (p_result);
Успешно скомпилировано, но запись не вставлена в таблицу.
CREATE or REPLACE package WSH_Delivery_Detail_Shipment is
type Result IS VARRAY(8) OF INTEGER;
p_result Result:=Result();
PROCEDURE CreateShipment(p_delivery_detail_interface_id IN
WSH_DEL_DETAILS_INTERFACE.DELIVERY_DETAIL_INTERFACE_ID%TYPE,p_status OUT
String);
PROCEDURE CreateShipmentLines(p_result IN RESULT);
END WSH_Delivery_Detail_Shipment;
/
CREATE OR REPLACE package body WSH_Delivery_Detail_Shipment as
PROCEDURE CreateShipment(p_delivery_detail_interface_id IN
WSH_DEL_DETAILS_INTERFACE.DELIVERY_DETAIL_INTERFACE_ID%TYPE,p_status OUT
String)
IS
CURSOR wddi_cur IS SELECT * FROM WSH_DEL_DETAILS_INTERFACE WHERE
DELIVERY_DETAIL_INTERFACE_ID=p_delivery_detail_interface_id;
wddi_record WSH_DEL_DETAILS_INTERFACE%ROWTYPE;
p_result Result:=Result(1,1,1,1,1,1,1,1);
BEGIN
OPEN wddi_cur;
LOOP
FETCH wddi_cur into wddi_record;/* Validation2 : Check if Organization Id
exists and store Organization_Id corresponding to Organization_Code*/
EXIT when wddi_cur%NOTFOUND;
>>>>>CODE>>>>>
CreateShipmentLines(p_result); // Calling Procedure 2 for insertion
END LOOP;
CLOSE wddi_cur;
END CreateShipment;
procedure CreateShipmentLines(p_result IN RESULT)
is
BEGIN
INSERT INTO WSH_DELIVERY .......
COMMIT;
END CreateShipmentLines;
END WSH_Delivery_Detail_Shipment;
/