0
I made the following code:
CREATE
OR
replace noneditionable
PROCEDURE comissao
IS
BEGIN
FOR v_linha IN
(
SELECT p.codvendedor AS codvend,
p.comissao AS comissao,
SUM(f.valortotal) AS quant
FROM vendedor p
left join venda f
ON p.codvendedor = f.codvendedor
GROUP BY p.codvendedor,
p.comissao)
LOOP
BEGIN
UPDATE vendedor
SET valor = v_linha.quant * (v_linha.comissao/100)
WHERE vendedor.codvendedor = vlinha.codvend;
END;
END LOOP;
END comissao;
SQL DEVELOPER is showing error:
This UPDATE is wrong?.
Vlinha <> v_linha ...
– Motta
Thank you very much. I messed up too badly on this one.
– Lucas Martins
:) is part ...
– Motta