I'm getting the following error when this statement is run:
ERROR : File 'exec_stored.c', function 'nInvokeStoredProcedure', line 391
Error : Stored procedure reports error 20001, 'post_each_file : 300 - update where already received ORA-01427: single-row subquery returns more
than one row'.
UPDATE
f_flash_daily_feed f
SET
(
f.otc_incl_vat,
f.levy_items,
f.non_levy_items,
f.pills_items
)
=
(
SELECT DISTINCT
(s.otc_incl_vat + f.otc_incl_vat),
(s.levy_items + f.levy_items),
(s.non_levy_items + f.non_levy_items),
(s.pills_items + f.pills_items)
FROM
s_flash_daily_feed s
WHERE
s.date_id = f.date_id and
s.branch_id = f.branch_id)
WHERE
EXISTS
(
SELECT
1
FROM
s_flash_daily_feed
WHERE
date_id = f.date_id and
branch_id = f.branch_id and
error_message IS NULL);
ERROR : File 'exec_stored.c', function 'nInvokeStoredProcedure', line 391
Error : Stored procedure reports error 20001, 'post_each_file : 300 - update where already received ORA-01427: single-row subquery returns more
than one row'.
UPDATE
f_flash_daily_feed f
SET
(
f.otc_incl_vat,
f.levy_items,
f.non_levy_items,
f.pills_items
)
=
(
SELECT DISTINCT
(s.otc_incl_vat + f.otc_incl_vat),
(s.levy_items + f.levy_items),
(s.non_levy_items + f.non_levy_items),
(s.pills_items + f.pills_items)
FROM
s_flash_daily_feed s
WHERE
s.date_id = f.date_id and
s.branch_id = f.branch_id)
WHERE
EXISTS
(
SELECT
1
FROM
s_flash_daily_feed
WHERE
date_id = f.date_id and
branch_id = f.branch_id and
error_message IS NULL);