Fórum problema com while #28771
30/03/2007
0
WHILE TABELA.CAMPO < 100 LOOP
INSERT INTO TABELA(CAMPO) SELECT MAX(CAMPO) + 1 FROM TABELA;
END LOOP;
ME AJUDEM...!!!
Stgmta
Curtir tópico
+ 0Posts
30/03/2007
Motta
declare vn number; begin select max(campo) + 1 into vn from tabela; -- for i in 1..100 loop insert into tabela (campo) values (vn+1); end loop; end;
Gostei + 0
30/03/2007
Arf
begin
for i in ( select <campo> from <tabela> where <condição>´ ) loop
execute immediate ´insert into <tabela> ´ || i.max(campo)||´+1´;
end loop;
end;
/
PS: Código não testado.
ARF.
Gostei + 0
30/03/2007
Motta
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)