Pular para o conteúdo

Fóruns Banco de dados Oracle Coluna auto incremento? Coluna auto incremento?

#91207
Ishii
Participante

    Olá,

    Eu uso o código:


    alter sequence increment by nocache;
    select .nextval from dual;
    alter sequence increment by 1 nocache;
    declare
    LastValue integer;
    begin
    loop
    select .currval into LastValue from dual;
    exit when LastValue >= - 1;
    select .nextval into LastValue from dual;
    end loop;
    end;
    /
    alter sequence increment by 1 nocache;

    []s Ishii