|
-
I have a composite primary key on one of my tables. It's made up of three columns - all the cols in the table. When I tried to add data where one of the columns is the same I get a unique key violation eg:
insert into prod_attr(prod_id, attr_cd, attr_val)
Select from prod_table prod_id, 'title', title
1 row inserted
BUT when I try
insert into prod_attr(prod_id, attr_cd, attr_val)
Select from prod_table prod_id, 'artist', artist
it gives me a unique key constraint violation - but if the PK is a composite of the 3 keys then those 2 rows are unique. What am I missing? Thanks, folks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|