|Previous Index Next How To Use|
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:
The visual representation of a table is a rectangle with a header and optional columns.
A table "Orders"
In the above example, there's a table ORDERS, the primary key is ORDERID and there's at least 1 foreign key constraint from this table to another table for column CUSTID.
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 Canvas. A new empty Table will be created, added to the list in the Diagram Explorer and added to the Canvas.
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 Canvas 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
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 Canvas 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
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 Canvas. If you're deleting from the Canvas 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.
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 Canvas.
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.