A
N
O
RACLE
N
ETWORK
T
RAVERSAL
PL/SQLP
ROGRAM
Author:Brendan FureyCreation Date:14 June 2010Version:1.2Last Updated:21 January 2012
82007373.doc.Page 1 of 37
Table of Contents
Introduction .......................................................................................................4Hardware/Software Summary ......................................................................4Network Package Structure ...............................................................................5Package Structure Diagram .........................................................................5Procedure Listing .........................................................................................5Data Structures ...........................................................................................6
Links Array ......................................................................................................... 6Nodes Array ....................................................................................................... 6Neighbour Reference Cursor .............................................................................. 6
Programming Constructs Summary .............................................................6Algorithm Design ...............................................................................................8Call Structure Diagrams ...............................................................................8
Procedure Timing ............................................................................................... 8Main Procedures ................................................................................................ 9
Timing Procedures .....................................................................................10
Any Calling Procedure ...................................................................................... 10Init_Time .......................................................................................................... 10Increment_Time ............................................................................................... 10
Init Procedure ............................................................................................10Expand Network Procedure .......................................................................10
Extend_One_Level............................................................................................ 10Check_Node ..................................................................................................... 10Add_Link .......................................................................................................... 11
Write Output Procedure .............................................................................11
Write_Links ...................................................................................................... 11Write_Nodes ..................................................................................................... 11Write_Tree ....................................................................................................... 11Write_One_Level.............................................................................................. 11
Application to Foreign Key Networks ...............................................................13Foreign Key Network 1 – Oracle’s HR Demo Schema .................................13
Output ............................................................................................................. 13Entity Relationship Diagram ............................................................................. 14Network Diagram ............................................................................................. 15
Output ............................................................................................................. 15Entity Relationship Diagram ............................................................................. 17Network Diagram ............................................................................................. 18
Application to General Networks .....................................................................19All Objects Networks ..................................................................................19All Objects Network 1 – 400 Objects Subset ..............................................19
Output ............................................................................................................. 19Network Diagram ............................................................................................. 21
Performance Tuning ..................................................................................23
Write_Tree ....................................................................................................... 23Open_Node ...................................................................................................... 23
PL/SQL Code ....................................................................................................24Network Package .......................................................................................24
Object Types .................................................................................................... 24Package ........................................................................................................... 24
Network_Node Package .............................................................................30
82007373.docPage 2 of 37
Client SQL ..................................................................................................35
Foreign Key Network ........................................................................................ 35Objects Network .............................................................................................. 36
Change Record
DateAuthorVersionChange Reference
13-Jun-2010BPF1.0Initial20-Jun-2010BPF1.1Added performance tuning section, and updated code
82007373.docPage 3 of 37
Reward Your Curiosity
Everything you want to read.
Anytime. Anywhere. Any device.
No Commitment. Cancel anytime.