
SQL CODE -625 while creating primary key
Sat, 06/18/2011 - 06:05
SQL CODE -625 while creating primary key
I was trying to create a new primary key on a table by dropping the existing primary key. I got the sql code of -625, when I tried to create the new primary key and the error message read as
SQLCODE = -625, ERROR: TABLE Tablename DOES NOT HAVE AN INDEX TO ENFORCE THE UNIQUENESS OF THE PRIMARY OR UNIQUE KEY
Do I need to define a Unique index on the table for the new primary key ?
"; ; ; ;Click the +1 button below to share it with your friends and colleagues
Share this if you liked it!
Yes, that is true. Create an index on the Column you want as the new Primary Key and then define that column as the Primary Key. If it is the Primary key, then there should be No Duplicate values in the that column.
Hope this helps.
Jerry