oracle - pl/sql update procedure with cursor gets stuck -


i wrote program uses cursor in order update row in these table- here program:

declare    -- local variables here    cursor s          (select unique *          sellers         id_seller not in (select id_seller                                   sellers natural join sales));     s_rec   sellers%rowtype; begin    -- test statements here    open s;     loop       fetch s s_rec;        exit when s%notfound;       dbms_output.put_line (s_rec.id_seller);       dbms_output.put_line (s_rec.salary);       updatesalary (s_rec.id_seller, s_rec.salary - 50);    end loop;     close s; end; 

this procedure updatesalary:

create or replace procedure updatesalary (id_s        in varchar2,                                           newsalary   in float) begin    update sellers s       set s.salary = newsalary     s.id_seller = id_s; end updatesalary; 

when running program, stuck @ update command. wrong procedure?

in order update table inside cursor need open cursor in "for update" mode , add query "for update" :

(select unique *      sellers     id_seller not in (select id_seller                               sellers natural join sales) update); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -