Search notes:

Oracle: Creating graphviz files showing referential integrity dependencies

The following query creates a Graphviz file that shows referential integrity dependencies:
with tabs as (
    select
       user own,
       table_name tab
    from
       user_tables
    where
       table_name like '‥'
    and
       table_name not in (‥)
)
select 'digraph {  node [shape = box]' l from dual union all
select
-- lower(substr(tac.tab, 9) || ' -> ' || substr(tap.tab, 9))  l
   lower(       tac.tab     || ' -> ' ||        tap.tab    )  l
from
   tabs                 tap                                                                            join
   dba_constraints      cpk  on tap.own   = cpk.owner and tap.tab             = cpk.table_name         join
   dba_constraints      cfk  on cpk.owner = cfk.owner and cpk.constraint_name = cfk.r_constraint_name  join
   tabs                 tac  on tac.own   = cfk.owner and tac.tab             = cfk.table_name
union all
   select '}' from dual;

See also

Creating a graphviz file showing object dependencies.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:51 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(51): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(66): id_of(Object(PDO), 'uri', '/notes/developm...') #2 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758200826, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #3 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/objects/tables/constraints/referential-integrity/query/graphviz(58): insert_webrequest() #4 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 51