PROCEDURE ignoring update - PL-SQL

Asked

Viewed 35 times

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: inserir a descrição da imagem aqui

This UPDATE is wrong?.

  • Vlinha <> v_linha ...

  • Thank you very much. I messed up too badly on this one.

  • :) is part ...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.