Monday, June 4, 2018

how many rows update using loop in oracle using pl/sql procedure

set serveroutput on


declare

cursor c1 is

select a,B from ab;

counter integer := 0;

begin

for cr in c1 loop

update item

set BASIC_PRICE=cr.b

where itemcode=cr.a;

counter := counter + sql%rowcount;

end loop;

dbms_output.put_line('Number of total lines affected update operation: '||counter);

end;

/



Number of total lines affected update operation: 128

PL/SQL procedure successfully completed.

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...