You can create a foreign key relationship between tables. A foreign key relationship acts as a constraint; for new rows inserted in the child table, the database server checks to see if the value you are inserting into the foreign key column matches a value in the primary table's primary key.
Prerequisites
You must have SELECT privilege on the table or the SELECT ANY TABLE system privilege.
You must also be the owner of the table, or have one of the following privileges:
Context and remarks
You do not have to create a foreign key when you create a foreign table; the foreign key is created automatically.
In Sybase Central, use the SQL Anywhere 16 plug-in to connect to the database.
In the left pane, double-click Tables.
Select the table for which you want to create or a foreign key.
In the right pane, click the Constraints tab.
Create a foreign key:
Click File » New » Foreign Key.
Follow the instructions in the Create Foreign Key Wizard.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |