too many rows found
I have two data blocks, one data block joins two tables and second datablock is based on one table.
first datablock has all fields with 1:1 relationship with Packing_id and second data block details has multiple rows
for every Packing_id. I wrote 2 procs for 2 datablocks are called in respective Post-Query trigger.
My problem is when I am running forms it gives error Message('too many rows found_orders_begin');
Here are my codes.
PROCEDURE post_query IS
CURSOR mast_cur IS
SELECT pa.ship_to_last_name,
pa.ship_to_first_name,
pa.ship_to_address1,
pa.ship_to_address2,
pa.ship_to_city,
p.packing_id,
FROM packing_attributes pa,packing p
WHERE p.packing_id ; = pa.packing_id
AND p.packing_id ; = :PACKING_JOINED.PACKING_ID;
BEGIN
Message('too many rows found_orders_begin');
OPEN mast_cur;
loop
FETCH mast_cur INTO :PACKING_JOINED.SHIP_TO_LAST_NAME,
:PACKING_JOINED.SHIP_TO_FIRST_NAME,
:PACKING_JOINED.SHIP_TO_ADDRESS1,
:PACKING_JOINED.SHIP_TO_ADDRESS2,
:PACKING_JOINED.SHIP_TO_CITY,
:PACKING_JOINED.PACKING_ID,
end loop;
CLOSE mast_cur;
EXCEPTION
WHEN too_many_rows THEN
Message('too many rows found');
WHEN no_data_found THEN
Message('no data was found there');
WHEN OTHERS THEN
Message('do something else');
END post_query;
***********************************************************************************
Detail proc
PROCEDURE post_query IS
CURSOR det_cur IS
SELECT pd.quantity,
pd.stock_number,
FROM packing_details pd,packing p
WHERE p.packing_id ; = pd.packing_id
AND pd.packing_id = :PACKING_JOINED.PACKING_ID;
BEGIN
Message('too many rows found_pack_begin');
OPEN det_cur;
FETCH det_cur INTO
:DETAILS.QUANTITY,
:DETAILS.STOCK_NUMBER,
CLOSE det_cur;
EXCEPTION
WHEN too_many_rows THEN
Message('too many rows found');
WHEN no_data_found THEN
Message('no data was found there');
WHEN OTHERS THEN
Message('do something else');
END post_query;
Thanks in advance for your help.
Sandy