Sybase 2 Barcode Reader User Manual


 
Working with keys
78 DataWindow .NET
Defining foreign keys
If your DBMS supports foreign keys, you can define them in DataWindow
Designer.
To create a foreign key:
1 Do one of the following:
Highlight the table and click the Create Foreign Key drop-down
toolbar button in PainterBar1.
Select Object>Insert>Foreign Key from the main menu or
New>Foreign Key from the pop-up menu.
Expand the table’s tree view and right-click on Foreign Keys and
select New Foreign Key from the pop-up menu.
The Foreign Key properties display in the Object Details view. Some of
the information is DBMS-specific.
2 Name the foreign key in the Foreign Key Name box.
3 Select the columns for the foreign key.
4 On the Primary Key tab page, select the table and column containing the
Primary key referenced by the foreign key you are defining.
Key definitions must match exactly
The definition of the foreign key columns must match the primary key
columns, including datatype, precision (width), and scale (decimal
specification).
5 On the Rules tab page, specify any information required by your DBMS.
For example, you might need to specify a delete rule by selecting one of
the rules listed for On Delete of Primary Table Row.
For DBMS-specific information, see your DBMS documentation.
6 Right-click on the Object Details view and select Save Changes from the
pop-up menu.
Any changes you make in the view are immediately saved to the table
definition.