I am getting the ORA-1422 error. Here is the error:
Connecting to the database Quantum Train. ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at "TRAIN.UPDATE_MASTER_TO_NULL", line 26 ORA-06512: at line 2 Process exited. Disconnecting from the database Quantum Train.
PROCEDURE UPDATE_MASTER_TO_NULL
is
-- This gets the pnm_auto_keys for the records in the warehouse and location with the specified manufacturer
Cursor Csr is
Select pnm.loc_auto_key
from parts_master pnm join warehouse whs on pnm.whs_auto_key = whs.whs_auto_key
where whs.warehouse_code = 'SHOP' and
pnm.loc_auto_key <> '39';
-- pnm.loc_auto_key <> '39' and
-- pnm.loc_auto_key <> '26' and
-- pnm.loc_auto_key <> '14';
loc_key integer;
Begin
For i in Csr Loop
-- Now get the loc_auto_key for your new location
Select loc2.loc_auto_key
into loc_key
From PARTS_MASTER loc2
Where loc2.loc_auto_key is null;
-- Assigne the new loc_auto_key to the selected record.
Update parts_master pnm2
Set pnm2.loc_auto_key = loc_key
where pnm2.loc_auto_key = i.loc_auto_key;
End Loop;
Commit;
End UPDATE_MASTER_TO_NULL;
Thanks,
Jeff