存储过程实现
declare
Type arr_tab_type Is Table Of Number(2) Index By Binary_Integer;
tab arr_tab_type;
begin
for i in 1..7 loop
if i<>7 then
Select trunc(dbms_random.Value(1,34)) Into tab(i) From dual;
else
select trunc(dbms_random.value(1,17)) into tab(i) from dual;
end if;
if i>=2 and i<>7 then
for j in i..1 loop
if tab(i)=tab(j-1) then
select trunc(dbms_random.Value(1,34)) into tab(i) from dual;
else
null;
end if;
end loop;
end if;
dbms_output.put_line(tab(i));
end loop; end;