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

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