Having a sequence, I need to find out which table.column gets its values. As far as I know, Oracle doesn\'t keep track of this relationship. So, looking up for the sequence
The problem is that Oracle allows us to use one sequence to populate columns in several tables. Scenarios where this might be desirable include super-type/sub-type implementations.
You can use the dependencies in the data dictionary to identify relationships. For instance, if you use triggers to assign the values then this query will help you:
select ut.table_name
, ud.referenced_name as sequence_name
from user_dependencies ud
join user_triggers ut on (ut.trigger_name = ud.name)
where ud.type='TRIGGER'
and ud.referenced_type='SEQUENCE'
/
If you use PL/SQL then you can write something similar for TYPE in ('PACKAGE BODY', 'PROCEDURE', 'FUNCTION')
, although you will still require some trawling through the source code to assign tables and sequences when you have multiple hits.