What kind of constrain are you creating? Can you show the command you are using to build the constraint?
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
DB2 Data Model
Collapse
X
-
DB2 Data Model
If you are trying to use this cross index file as the parent file in a referential constraint, then the 1 digit numeric code must be unique. Try setting that column as unique and then creating the new referential constraint. (Assuming I understood the situation!) Kevin
-
DB2 Data Model
I would love to be able to make it unique, but alas I cannot. The uniqueness is in the 3 character code that comes from the store system Bl1, BL2, RFL are unique codes but all are grouped under the heading of MidRange fuel. I appreciate the suggestions and am trying to move the DB towards a more structured, normalized form. Since more and more people are trying to access data via SQL statements I am not experiencing the resistance I had at first. Again, thanks for the response. Bill
Comment
-
DB2 Data Model
We are in the process of creating a data model for one of our apps and we are using iSeries Navigator to create SQL Tables in a separate library of all of our PF's. In setting up the relations I have come to a snag. We are a convenience store chain and sell gas. We have to price that gas to make a profit. We have codes for the different grades. The problem comes in when we sell the normal 3 grades UNL, MID, PRM. Under the covers the MID can be any number of different things, Blended, Re formulated etc. So we have a tax code of '6' to cover all the different ways we come up with a Mid-range fuel. We also have a Xref table that crosses the 3 letter codes (unique) to the numeric code 1-6. The 3 letter code is the PKEY and I created an index using the 1 digit numeric non-unique. I want to place a constraint on a file that references the 1 digit number but can't seem to do it. What am I doing wrong??? TIA Bill Barnes
Comment
-
DB2 Data Model
So, you don't have a file with the single digit codes? Normalized file design would say you should. Then you'd have a constraint like you wanted to, plus a constraint on the BL1, BL2 file to make sure only the correct single digit codes were used in that file as well. -dan
Comment
Comment