InterBase Referential Integrity – InterBase Labs

InterBase Referential Integrity

InterBase has a number of options for Referential Integrity that are powerful to use and simplify keeping data valid.

This video covers (more reading from the InterBase DocWiki on the links here)

Tip for adding Constraints.

One very cool tip in the video is to use constraints to add in a unique key, this way you can drop it easily at runtime.  Remember, the field needs to be marketed NOT NULL to enable a primary or unique key.

ALTER TABLE CUSTOMER ADD CONSTRAINT U_TEST UNIQUE (CUSTOMER_NAME);

The above example names the constraint U_TEST. (you can put whatever value you want in to name it, making it easy to drop with the following statement.

ALTER TABLE CUSTOMER DROP CONSTRAINT U_TEST;

InterBase Labs

For more InterBase Labs videos visit the InterBase pages on the Embarcadero website.

Leave a Reply

Your email address will not be published. Required fields are marked *