문제

Is there a way to retrieve all the sequences defined in an existing oracle-sql db schema?

Ideally I would like to use something like this:

SELECT * FROM all_sequences WHERE owner = 'me';

which apparently doesn't work.

도움이 되었습니까?

해결책

Try this:

SELECT object_name
  FROM all_objects
 WHERE object_type = 'SEQUENCE' AND owner = '<schema name>'

다른 팁

Yes:

select * from user_sequences;

Your SQL was almost correct too:

select * from all_sequences where sequence_owner = user;

Below query can be triggered in Oracle Developer to check whether sequence present in DB or not :

SELECT count(*) count FROM user_sequences WHERE sequence_name = 'SEQ_NAME';

If 'SEQ_NAME' present in your DB then count will return 1 else 0 .

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top