Professional Documents
Culture Documents
Taller 1
Taller 1
declare
num2 number:=0;
begin
num1:=&num1;
num2:=&num2;
total :=num1+num2;
end;
set serveroutput on
declare
num2 number:=0;
num3 number:=0;
begin
num1:=&num1;
num2:=&num2;
num3:=&num3;
mayor :=num1;
mayor :=num2;
else
mayor :=num3;
end if;
end;
/
declare
num2 number:=0;
total number:=0;
begin
num1:=&num1;
num2:=&num2;
operacion:=’&operacion’;
CASE operacion
when ‘+’ then total := num1+num2;
if (num2>0) then
total := num1/num2;
else
end if;
else
end case;
end;
/
declare
num2 number:=0;
total number:=0;
fechayhora varchar2(30):=’’;
begin
num1:=&num1;
num2:=&num2;
operacion:=’&operacion’;
into fechayhora
from dual;
CASE operacion
if (num2>0) then
total := num1/num2;
else
end if;
else
end case;
end;
/
declare
num2 number:=0;
total number:=0;
fechayhora varchar2(30):=’’;
begin
num1:=&num1;
num2:=&num2;
operacion:=’&operacion’;
into fechayhora
from dual;
CASE operacion
if (num2>0) then
total := num1/num2;
else
end if;
else
end case;
end;
/
declare
begin
num1:=&num1;
for i in 1..num1
loop
nums:=num1+i;
end loop;
dbms_output.put_line(‘numero :’ || nums);
end;