Defining Tables

Previous  Top  Next

Tables store your data, values about real-world objects or happenings. Each row of data represents a set of data values valid for the object or occurrence.


See also: Objects is a PDM, Table


This topic holds the following items:

Creating a table
Modifying a table
Deleting a table
Tables in sub-diagrams


The visual representation of a table is a rectangle with a header and optional columns.


A table "Person"


In the above example, there's a table PERSON that's used to store data about persons, the primary key is PERSONID.



Creating a table

Creating a new table is done by using the Table button ( ) on the Toolbox Toolbar, this will change the cursor and allows you to click on an empty space in the Editor Workspace. A new empty Table will be created, added to the list in the Diagram Explorer and added to the workspace.


A Table needs at least 1 column in order to be useful. It is recommended to include a primary key for the Table as well.


Each Table has a name, this should be a valid name in the SQL statement used to create the table and a user written description under Notes for clarity and it's meaning in the model.


Double click the Table in the Diagram Explorer or Workspace to show the Table Properties dialog.


Table Properties dialog


The Columns tab shows you the table columns and their properties, you can add, delete, modify or copy columns here.


On the DDL tab, you can view the SQL statement needed to create the table, or to modify an existing table after you've modified the column properties in the dialog.


See also: Tables in sub-diagrams


Back to Top



Modifying a table

By double clicking a table in the Diagram Explorer or using the context menu and selecting Properties from the popup menu, you can start the Table Properties dialog for existing tables. You can also use the context menu in the Editor Workspace and select Columns from the menu to open up the dialog at a different page.


Use the OK button to accept your changes or ESC on your keyboard or the Cancel button to discard your changes. When editing, you can switch to the DDL tab at the top of the dialog and then to Modifications at the bottom of the tab to view the DDL for your changes.


See also: Defigning Foreign Key Constraints


Back to Top



Deleting a table

You can delete a table by using the context menu and selecting Delete Table from the popup menu or by pressing DEL on your keyboard when a table is selected in the Editor Workspace. If you're deleting from the Workspace in the main diagram, a special confirmation dialog will be shown. If you delete the table from the Diagram Explorer, this dialog will not be shown and any foreign key constraints (links to other tables) for and to this table will be deleted.


Back to Top



Tables in a sub-diagram

You can create new tables in sub-diagrams too, they will be added to the Tables list in the Diagram Explorer and to the diagram. To re-use existing tables, drag them from the Diagram Explorer onto the Workspace.


If there are existing foreign key constraints for tables in the current diagram, you can use the context menu on the table and select Visualize Foreign Keys to re-establish the visual representation of the referential constraints between different tables.


Back to Top