Hello, In an SQL procedure I am getting an SQL error >>> ORA-01422: 'exact fetch returns more than requested number of rows' on an table insert statement.
I am puzzled to say the least. Anyone seen this before ?
==============
BEGIN
INSERT INTO sysadm.ps_cu_sp_eq_stg
(
sp_id
,item_id_eq
,install_dt
,removal_dt
,eq_cnt
,commentsmed
,fa_id
,step_seq_nbr
,insert_dttm
,process_dttm
,error_msg
,staging_flg
)
VALUES
(
vwh_sp_id
,vwh_item_id
,vwh_read_dt_tm --Install Date
,NULL -- Remove Date
,v_eq_cnt -- set to be 1 (one)
,'NEW ITEM FFDS INSTALLED' -- fixed comment
,vwh_fa_id
,vwh_step_seq_nbr
,SYSDATE
,NULL
,p_space
,v_staging_flag --N = NEW
);
EXCEPTION
WHEN OTHERS
THEN
p_stuff_record := 'INSERTING INTO ps_cu_sp_eq_stg FOR NEW ITEMS'
|| vwh_fo_id || ' '
|| vwh_step_seq_nbr ||' '
|| vwh_item_id || ' '
|| vwh_prem_id ||' '
|| vwh_fa_id || ' '
|| vwh_sp_id;
ROLLBACK;
END;
I am puzzled to say the least. Anyone seen this before ?
==============
BEGIN
INSERT INTO sysadm.ps_cu_sp_eq_stg
(
sp_id
,item_id_eq
,install_dt
,removal_dt
,eq_cnt
,commentsmed
,fa_id
,step_seq_nbr
,insert_dttm
,process_dttm
,error_msg
,staging_flg
)
VALUES
(
vwh_sp_id
,vwh_item_id
,vwh_read_dt_tm --Install Date
,NULL -- Remove Date
,v_eq_cnt -- set to be 1 (one)
,'NEW ITEM FFDS INSTALLED' -- fixed comment
,vwh_fa_id
,vwh_step_seq_nbr
,SYSDATE
,NULL
,p_space
,v_staging_flag --N = NEW
);
EXCEPTION
WHEN OTHERS
THEN
p_stuff_record := 'INSERTING INTO ps_cu_sp_eq_stg FOR NEW ITEMS'
|| vwh_fo_id || ' '
|| vwh_step_seq_nbr ||' '
|| vwh_item_id || ' '
|| vwh_prem_id ||' '
|| vwh_fa_id || ' '
|| vwh_sp_id;
ROLLBACK;
END;