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

How to install and configure Oracle Apex 24.1 with ORDS 22, Tomcat 9 and Jasper Report 7 on Oracle Linux 8.10

#########################Install Oracle  APEX 24.1################################ ----------------------------------------------------...