Questão 59 · TRT-8 2016 · Técnico · Tecnologia da Informação

begin
execute immediate 'create table tabela_trt ( coluna integer, nome varchar2(20) )';
commit;
end;
/
declare
type t_ValueTable is table of varchar2(10)
index by binary_integer;
v_Values t_ValueTable;
i integer;
begin
v_Values(1) := -2;
v_Values(3) := 0;
v_Values(-2) := 1;
v_Values(0) := 2;
v_Values(100):= 100;
v_Values.DELETE(100);
v_Values.DELETE(1,3);
i := v_Values.first;
while i is not null
loop
DBMS_OUTPUT.PUT_LINE (i);
insert into tabela_trt (coluna, nome)values(i,v_Values(i));
i := v_Values.next(i);
end loop;
end;
/

Considerando-se que os dois códigos PL/SQL são executados em um SGBD Oracle, assinale a opção que apresenta o conteúdo da tabela de nome tabela_trt.
  1. A)[Tabela: coluna | nome; -2 | 1; 0 | 3; 1 | -2; 3 | 0; 100 | 100]
  2. B)[Tabela: coluna | nome; -2 | 1; 1 | -2; 3 | 0; 100 | 100]
  3. C)[Tabela: coluna | nome; -2 | 1; 1 | -2; 100 | 100]
  4. D)[Tabela: coluna | nome; 1 | -2; 3 | 0]
  5. E)[Tabela: coluna | nome; -2 | 1; 0 | 3]
Responder e ver o gabarito comentado →

Grátis, sem cartão. No Chip você responde, vê o gabarito e o comentário com a pegadinha, o macete e o fundamento na lei.