I have the following code in Oracle Forms detail block
BEGIN
v_product_no := :detail_block.product_no;
Go_block('detail_block');
first_record;
--some if condition
WHILE :SYSTEM.last_record != 'TRUE' LOOP
next_record;
if(:detail_block.product_no = v_product_no) then
-- other condtions
end if;
END LOOP;
I would like to store v_product_no into a some kind of collection object so that I could compare with value of :detail_block.product_no.
How can I do this?
Edit 1
product_no will have values such as K1BATTERY, K2BATTERY, ZCATBATEERY etc.
So if K1BATTERY is same as :detail_block.product_no then proceed with next condition
Edit 2
Go_block('detail_block');
v_product_no := :detail_block.product_no;
v_products(v_product_no) := 1;
first_record;
WHILE :SYSTEM.last_record != 'TRUE' LOOP
if(v_products.exists(v_product_no)) then
alert('duplicate');
end if;
END LOOP;
END if;
Edit 3
Go_block('detail_block');
v_product_no := :detail_block.product_no;
v_products(v_product_no) := 1;
first_record;
-- condition
WHILE :SYSTEM.last_record = 'FALSE' LOOP
next_record;
v_product_no := :detail_block.product_no;
if(v_products.exists(v_product_no)) then
alert('duplicate');
else
v_products(v_product_no) := 1;
end if;
END LOOP;
END if;
product_nois getting repeated, then I would like to have another if condition to be evaluated in same detail block. Havingv_product_nostored invarchar2is not helping to compare values in multi record block. Thanks:detail_block.product_no? Please show an example, I will try to reproduce what you want.