We have a client that does {something}, and after that some of our sequences return numbers that have already been used. Although the long-term answer will be that they stop doing something, I need an easy way to check the sequences on the tables in which they are used.
I can query user_sequencesto get last_numberfor each sequence, and I can get max(id_number)for every table. But when I try to do both in the same request, I return null.
My broken SQL:
select max(last_number) , max(id_number) from user_sequences,
squiggly.ACCOUNT_CODE_DEFINITION where sequence_name = 'ACCOUNT_CODE_DEFINITION_SEQ'
and sequence_owner = 'SQUIGGLY' ;
source
share