Поняла свои ошибки, спасибо!
Рабочий вариант:
set serveroutput on
DECLARE
v_operquan real;
v_count integer:=1;
BEGIN
for r in ( select supermag.smcard.name,
supermag.smcard.article,
supermag.smopergoods.salequantity,
supermag.smopergoods.returnquantity,
supermag.smgoods.quantity,
Listagg(supermag.smstoreunits.barcode, ', ')WITHIN GROUP (ORDER BY supermag.smstoreunits.barcode) as barcode
from supermag.smcard,
supermag.smopergoods,
supermag.smgoods,
supermag.smstoreunits
where supermag.smcard.accepted='1'
and supermag.smcard.article=supermag.smgoods.article
and supermag.smcard.article=supermag.smopergoods.article
and supermag.smstoreunits.article=supermag.smcard.article
group by supermag.smcard.name,
supermag.smcard.article,
supermag.smopergoods.returnquantity,
supermag.smopergoods.salequantity,
supermag.smgoods.quantity)
loop
V_count:=V_count+1;
v_operquan:=r.quantity-NVL((r.salequantity),0)+NVL((r.returnquantity),0);
dbms_output.put_line (r.name||', '||r.article||', '||r.barcode||', '||v_operquan);
exit when SQL%NOTFOUND;
end loop;
END;
/