Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

single-row subquery error

292604Feb 14 2003
I'm having a hard time trying to find the problem in the following query:

UPDATE vod_preinvoices_export_t vpet
SET bonus =
(
SELECT nvl(SUM(ebit.amount), 0)
FROM event_t et, event_bal_impacts_t ebit, item_t it
WHERE it.bill_obj_id0 = vpet.preinvoice_id
AND et.item_obj_id0 = it.poid_id0
AND ebit.obj_id0 = et.poid_id0
AND ebit.resource_id = 978
AND et.poid_type like '/event/activity/cycle/fold%'
AND ebit.impact_category = 'PriceCategory1'
)
WHERE vpet.partner_id = 'partner'
AND vpet.contract_id = 15507
AND vpet.preinvoice_id = 12756
AND vpet.price_category = '15';


When I execute the select by itself I just get one row as a result (as you can see I'm doing a SUM). But I'm getting the error:

ORA-01427: single-row subquery returns more than one row

Does anyone know what could be the problem in the query above?

Many thanks
Lorenzo Santacana
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2003
Added on Feb 14 2003
0 comments
89 views