Monday, September 2, 2019

how to update table using cursor with number of total update rows display in sql command

set serveroutput on

DECLARE 
   total_rows number(2); 
BEGIN 
   UPDATE  STUDENT 
   SET CITY = 'Dhaka'
   where stid in ('1','2'); 
   IF sql%notfound THEN 
      dbms_output.put_line('no customers updated'); 
   ELSIF sql%found THEN 
      total_rows := sql%rowcount; 
      dbms_output.put_line( total_rows || ' customers updated '); 
   END IF; 
END; 
/

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################################ ----------------------------------------------------...