Tuesday, July 29, 2014

Sequences

Sequences
To reset the value of a Sequence:
------------------------------------------------------
SQL> alter sequence x increment by -4; Sequence altered. SQL> SELECT X.NEXTVAL FROM DUAL; 1 SQL> alter sequence x increment by 1; Sequence altered.
------------------------------------------------------
DEPENDENCIES OF A SEQUENCE:
------------------------------------

 set lines 132

select distinct
   owner,
   name,
   referenced_name
from
   dba_dependencies
where
   type in ('PACKAGE BODY','PROCEDURE','TRIGGER')
and
   referenced_type = 'SEQUENCE';

select
   referenced_name,
   referenced_type
from
   dba_dependencies
where
   name='my_tablename';

----------------------------------------

No comments:

Post a Comment