Generating Entity Relationship Diagrams


Sometimes a DBA or developer would like a mini-ERD (entity relationship diagram) for just a few tables of interest. For example, the developer might be writing code against a set of tables and would like to have a roadmap of their structure to code against. Having such a diagram can increase productivity while decreasing errors. For those shops that have a data-modeling tool such as Quest Software's QDesigner, this is no problem. But if your shop just has TOAD, you can still create basic, simple ERDs using the SQL Modeler (although indirectly). However, the process is significantly different than modeling SQL code as covered in the preceding section.

First, you merely select a table of interest in the Schema Browser and right-click to get a context menu selection of Model Table as shown in Figure 9.27. TOAD will then prompt you via a pop-up for how many referential levels deep to model, as shown in Figure 9.28. For example, if you want a table, its children, and its grandchildren ”you would specify two levels deep. Of course, this all requires foreign keys (that is, referential integrity) in order to work.

Figure 9.27. TOAD SQL Modeler ”model table.

Figure 9.28. TOAD SQL Modeler ” levels to model.

TOAD then launches you into the SQL Modeler with the tables that meet your selection criteria. You can then toggle to full-screen mode by pressing F2 and clean up the layout as shown in Figure 9.29. There is also an option now in TOAD to launch table models in full-screen mode by default. It's located in the TOAD Options for SQL Modeler, under the General category.

Figure 9.29. TOAD SQL Modeler ”mini-ERD.

Finally, you can use Copy Model Image to Clipboard to copy the mini-ERD to a program such as Microsoft Paint as shown in Figure 9.30. And voil  , you have a poor man's ERD. Note that this technique only works reasonably well for small to medium object counts. It's not a true replacement for a data-modeling tool.

Figure 9.30. Poor man's ERD copied to MS Paint.



TOAD Handbook
TOAD Handbook (2nd Edition)
ISBN: 0321649109
EAN: 2147483647
Year: 2003
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net