Quote:
|
But i need to find out the tables which are using those sequences.
|
You can't. Sequences are controlled by the program(s) that operate(s) on your database.
A sequence is a very flexible thing. You could define one sequence and use it to generate unique ID's for all the tabels in your database thereby giving each object (record) a unique ID, not only within its table but within the entire database.
I don't think this is common practice.
Code:
CREATE TABLE FOO (
ID INTEGER NOT NULL,
...
CONSTRAINT PK_FOO PRIMARY KEY (ID)
);
CREATE SEQUENCE MYSEQ START WITH 100;
The program could use MYSEQ to generate the PK for FOO, and there is no way you can find this connection by looking at the DDL scripts.
What you could do by trial and error is to get the next sequence (*) from MYSEQ and compare that to the most recent ID's of the tables you suspect are controlled by that sequence. If the values are close, there is a possibility they are connected. You should then create a new record using the program and verifu that the sequence is altered and that the PK of the record matches the sequence value (*).