IBM Data & AI

 Welcome to the IBM Data & AI Ideas Portal for Clients! 

IBM Employees:
Additional Information:
  • The shorter URL for this site is:
  • To view our roadmaps:

create a foreign key allowing one to one tables relationships

Our Primary Key and Foreign key constraints always have allowed creaing and ensuring '1 to many' table relationships. After researching, there is no direct way to implement such a case with Informix. The only safe way is to create a primary key on the 'parent' table, a unique index on the 'child' table plus a trigger with references that will catch insert and delete. This trigger will fire a SPL that will count the rows in the parent table matching the new key. If 1 row, the child row is created, else the SP returns an error. Same principle for DELETE

  • Sep 17 2019
  • Needs review
Why is it useful?
Who would benefit from this IDEA? Anyone who needs to implement a one to one relationship in a safe, generic and simple way
How should it work?

MS SQL Server has this feature, which is pretty well described in this URL

This kind of relationship can be created using Primary key-Unique foreign key constraints with MS Sql Server, and I suggest to use the same principle

Idea Priority Medium
Priority Justification
Customer Name kandooERP
Submitting Organization
Submitter Tags
  • Attach files
