set serveroutput on
declare
i number(10,2);
begin
i := &i;
while i<11
loop
dbms_output.put_line(i);
i := i+1;
end loop;
end;
/
Easy Learning... (Web Development,.NET Technology,Oracle,Silverlight,REST,SQL,Oracle,MySQL,Data Science, Python and many more ...)
set serveroutput on
declare
i number(10,2);
begin
i := &i;
while i<11
loop
dbms_output.put_line(i);
i := i+1;
end loop;
end;
/
set serveroutput on
declare
i number(10,2);
begin
for i in reverse 1..10
loop
dbms_output.put_line(i);
end loop;
end;
/
set serveroutput on
declare
i number(10,2);
begin
i := &i;
loop
dbms_output.put_line(i);
i := i+1;
exit when i = 11;
end loop;
end;
/
set serveroutput on
declare
i number(10,2);
begin
i := &i;
if i=1 then
dbms_output.put_line('black tea');
elsif i=2 then
dbms_output.put_line('green tea');
else
dbms_output.put_line('pink tea');
end if;
end;
/
SET serveroutput ON
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello World');
END;
/
SET SERVEROUTPUT ON
DECLARE
i number(10,2);
str1 varchar(20);
BEGIN
i := &i;
if i = 2 then
DBMS_OUTPUT.PUT_LINE('Input rejected');
else
str1 := '&str1';
DBMS_OUTPUT.PUT_LINE('Value of str =' || str1 );
end if;
END;
/