Hello,
I am looking for some input and see if someone can help me find a solution for the below PL/SQL Block that is used for a Right Click Menu.
The blow Block is supposed to fetch 2 tables and then if a value is not in the Customer order table to add them in the 2nd custom table (CUSTOM LU) and ensure there are no duplicate records created.
DECLARE
p0_ VARCHAR2(32000);
p1_ VARCHAR2(32000);
p2_ VARCHAR2(32000);
p3_ VARCHAR2(32000):= NULL;
P_ORDER_ VARCHAR2(32000);
P_VIN_ VARCHAR2(17):= NULL;
C_ORDER_ VARCHAR2(32000);
C_VIN_ VARCHAR2(17):= NULL;
CURSOR PLANNED_VINS IS
SELECT DISTINCT &AO.CUSTOMER_ORDER_LINE_CFP.Get_Cf$_Planned_Vin(objkey)
FROM &AO.customer_order_line WHERE ORDER_NO = &ORDER_NO and &AO.CUSTOMER_ORDER_LINE_CFP.Get_Cf$_Planned_Vin(objkey) is not NULL ;
CURSOR CHASSIS_TRACKER IS
SELECT DISTINCT CF$_FULL_VIN
FROM &AO.C_L_U_CHASSIS_TRACKER_CLV WHERE CF$_ORDER_NO = &ORDER_NO and CF$_FULL_VIN is not null;
BEGIN
OPEN PLANNED_VINS;
OPEN CHASSIS_TRACKER;
LOOP
FETCH PLANNED_VINS INTO P_VIN_;
FETCH CHASSIS_TRACKER INTO C_VIN_;
IF C_VIN_ = P_VIN_ OR C_VIN_ IS NOT NULL OR P_VIN_ IS NULL
THEN
Client_SYS.Clear_Attr(p3_);
ELSE
Client_SYS.Clear_Attr(p3_);
Client_SYS.Add_To_Attr('CF$_FULL_VIN',P_VIN_, p3_);
Client_SYS.Add_To_Attr('CF$_ORDER_NO',&ORDER_NO, p3_);
&AO.C_L_U_CHASSIS_TRACKER_CLP.NEW__( p0_ , p1_ , p2_ , p3_ , 'DO');
Client_SYS.Clear_Attr(p3_);
END IF;
EXIT WHEN PLANNED_VINS%NOTFOUND;
END LOOP;
CLOSE PLANNED_VINS;
CLOSE CHASSIS_TRACKER;
END;
Please Help