MySQL Forums
Forum List  »  MySQL Workbench

Re: Print ERD with auto-scaling tables - where is it gone?
Posted by: John Benson
Date: December 26, 2007 11:02PM

Hi, I'm starting out by using the Workbench ERD to model a set of tables that exist in a Tandem NonStop SQL database. Unfortunately, the most critical table has 198 columns and the ERD diagram utility has tremendous difficulty working with it. My guess is that a table that is too big to fit on the canvas causes undefined behavior, for example a negative Top diagram property and broken sizing handles!

I stumbled across this thread and immediately went to page setup to see if I could increase the canvas size, but no luck, for the reason that started this thread.

Working in an enterprise environment, I need a pretty big ERD canvas and wish to express my fervent desire for the same so I can draw ERDs with the legacy tables I have to work with. Until then, I hope to be able to work around the limitation by

1) punching in the foreign key relationships using dialogs, and
2) creating views on the really large tables, excluding the less important fields.

Question: Will the relationship connection lines between fields in base tables show up when views (table column subsets) are used to keep the diagram down to a manageable size?

Miscellaneous note:

Tandem's NonStop SQL uses COBOL-like PIC clauses in some of its SQL column definitions (e.g. PIC S9(4)V99) and MySQL choked on them during the import.

(In Tandem's defense I must point out that they had a fault-tolerant, linearly-scalable, distributed multiprocessor SQL database WITH TRANSACTIONAL INTEGRITY before the ANSI standard came out, so the funky PIC column definition clauses weren't a capricious post-standard lark.)

Luckily I have Cygwin on my PC and was able to munge the Tandem SQLCI "invoke =tabledefinename" command output to the point that it was usable by MySQL. Here is the script:

$ cat ns2mysql
sed 's/PIC \+S\?9(\([0-9]\+\))\([^V]\)/INTEGER(\1)\2/' |
sed 's/PIC \+S\?9(\([0-9]\+\))V99\([^9]\)/DECIMAL(\1, 2)\2/' |
sed 's/PIC \+S\?9(\([0-9]\+\))V9(\([0-9]\+\))/DECIMAL(\1, \2)/' |
sed 's/PIC \+S\?V9(\([0-9]\+\))/DECIMAL(\1, \1)/' |
sed 's/PIC \+X(/CHAR(/' |
sed 's/PIC X/CHAR(1)/' |
sed 's/PIC 9/INTEGER(1)/' |
sed 's/ DISPLAY//' |
sed 's/ DEFAULT SYSTEM//' |
sed 's/ COMP//' |
sed 's/SIGN IS LEADING//' |
sed 's/NO DEFAULT//' |
sed 's/NOT NULL//' |
sed 's/>>invoke =\([A-Z0-9]\+\);$/use sampledb;\ncreate table \1/' |
sed 's/^>>\(.*\)/-- \1/' |
sed 's/^+>.*//' |
sed 's/.*End of.*//' |
sed 's/^\( *\)) */\1)\n\1;/' |
sed 's/^\(\*\*\*.*$\)/-- \1/' |
sed 's/^SQL/-- SQL/' |
sed 's/^(C)/-- (C)/'
$

It took an evening to cobble together just now, but it successfully migrates over 200 Tandem NonStop SQL table definitions into the Workbench so I'm ready to roll with a real-world design. Once I have the ER/foreign-key stuff together, I hope to be able to import some data as well and browse it using PC GUI clients.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Print ERD with auto-scaling tables - where is it gone?
2856
December 26, 2007 11:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.