×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I can add the constraints but it doesn't do what I need it to. I have a check constraint of 'V' or blank and a referential constraint of 'P' or 'H' (more to come later). The 'V' and blank are hard coded into the program depending on certain conditions. If the user chooses an override the 'P' or 'H' will be used. Unfortunately they appear to be mutually exclusive.
I tried inserting a row using SQL and if I use one of the referential constraint values the insert fails due to the check constraint. If I use one of the check constraint values the insert fails due to the referential constraint. The value has to satisfy both constraints.
It makes sense, it just doesn't work for me in this case.
Rick
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Luis Rodriguez
Sent: Thursday, May 20, 2010 1:49 PM
To: Midrange Systems Technical Discussion
Subject: Re: Can I have check and referential constraint on same column?
No problem in creating both constraints. Even if there is a CARDTYPE 9 in File2, I can't insert a CARDTYPE 9 record in File1. The system returns CPF502F (Check constraint violation).
Did not check what happens the CHECK constraint is created before the foreign key...
HTH,
Luis Rodriguez
IBM Certified Systems Expert - eServer i5 iSeries
Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: Can I have check and referential constraint on same column?, (continued)
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.