Buscar

Lista 6 txt

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

\\1-
create or replace function tabuada (numero integer) returns void as $$
declare
fim integer;
contador integer;
resultado integer;
 begin
 contador:=1;
 fim :=10;
 while contador <=fim loop
 begin
 resultado = numero * contador;
 raise notice '% * % = %', numero, contador, resultado;
 contador = contador + 1;
 end;
 end loop;
 
end; $$
language plpgsql;
select * from tabuada (7)
\\2-
create or replace function tabuada_1 (de integer, ate integer, numero integer) returns void as $$
declare
fim integer;
contador integer;
resultado integer;
 begin
 contador:= de;
 fim := ate;
 while contador <=fim loop
 begin
 resultado = numero * contador;
 raise notice '% * % = %', numero, contador, resultado;
 contador = contador + 1;
 end;
 end loop;
 
end; $$
language plpgsql;
select * from tabuada_1 (3,6,7)

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando