Version : 11.2.0.4
Has anyone got a single query which will provide both parent and child tables of a particular table?
In the below example, Table B's parent table is Table A and child table is Table C. I am looking for a query which will list both parent and Child tables of TableB .
SQL> create table A (id number constraint A_PK Primary key, descr varchar2(10));
Table created.
SQL> create table B (B_id number constraint UQ_B Unique , A_id number, detail varchar2 (25));
Table created.
SQL> create table C ( C_ID number , someID number, somecol varchar2(25));
Table created.
SQL> alter table B add constraint fk_b_a foreign key (A_id) references A (ID) on delete cascade;
Table altered.
SQL> alter table C add constraint fk_c_b foreign key (someID) references B (B_ID) on delete cascade;
Table altered.