Skip to content

Instantly share code, notes, and snippets.

@thiago-vieira
Created July 17, 2014 20:48
Show Gist options
  • Save thiago-vieira/6286a86e656050211883 to your computer and use it in GitHub Desktop.
Save thiago-vieira/6286a86e656050211883 to your computer and use it in GitHub Desktop.
declare
l_MaxVal pls_integer;
l_Currval pls_integer default - 1;
begin
-- insert primary key and table name
select max(cod_os)
into l_MaxVal
from os;
while l_Currval < l_Maxval
loop
dbms_output.put_line (l_Currval);
-- insert sequence name
select seq_os.nextval
into l_Currval
from dual;
end loop;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment