Social Icons

Tuesday, 3 December 2013

IMPLICIT Cursor in PL/SQL

set serveroutput on;
declare
idc number(2);

begin

update e1111 set id=id+500;


if sql%notfound then
dbms_output.put_line('not found');

ELSIF sql%found THEN
      idc := sql%rowcount;
      dbms_output.put_line( idc || ' customers selected ');
   END IF;
END;

PL/SQL While Loop

set serveroutput on;
set verify off;
declare
i int:=1;
j int;
begin
WHILE i<10 loop
dbms_output.put_line(i);
i:=i+1;

end loop;

end;

output :













Printing pattern in PL/SQL

set serveroutput on;
set verify off;
declare
i int;
j int;
begin
for i in 1..5 loop
 dbms_output.put_line('');
 for j in 1..i loop
   dbms_output.put('*');
 end loop;
  dbms_output.new_line;
end loop;

end;

OUTPUT :


** 
*** 
**** 
*****

PL/SQL Simple Loop

set serveroutput on;
set verify off;
declare
b int:=1;
begin

loop
dbms_output.put_line(''||b);
b:=b+1;
exit when b>=10;
end loop;
end;

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management