创建新的序列

select NVL(count(Sequence_Name), 0)
    
into nCount
    
from all_sequences
   
where Sequence_Owner = 'LSP'
     
and Sequence_Name = 'SEQ_SHELFID';
  
if nCount > 0 then
    sSQL :
= 'drop sequence LSP.SEQ_SHELFID';
    
execute immediate sSQL;
  
end if;
  sSQL :
= 'create sequence SEQ_SHELFID minvalue 1 ' ||
          
' maxvalue 999999999999 start with ' ||
          GetNextID(
'LPMS.PBI_Shelf''ShelfID'|| ' increment by 1';
  
execute immediate sSQL;
posted on 2006-06-16 15:54  老狐狸  阅读(196)  评论(0)    收藏  举报