Informix Error Code 239
a duplicate value of some row that already exists, in a column or columns that are constrained to have unique values. Another cause of this error might be a locking conflict if the table lock mode is page. The new or updated row is not inserted. Roll back the current transaction and execute it again without any duplicate rows or with the locking conflict resolved.
If you are using repeatable read isolation, then the error could be due to a unique constraint being violated. Refer to error -268. Copyright Privacyof Contents Informix Dynamic Server (IDS) - Error Messages -239 Could not insert row - duplicate value in UNIQUE INDEX -242 Could not open database http://wiki.ispirer.com/sqlways/informix/error-messages table -268 Unique constraint violated -271 Could not insert new row into http://stackoverflow.com/questions/18002100/why-do-i-get-this-error-when-inserting-a-record-duplicate-value-for-a-record-wi the table -691 Missing key in referenced table for referential constraint -692 Key value for constraint constraint-name is still being referenced Ispirer Home Page Ispirer SQLWays Product Page - Migration to Informix Request SQLWays Informix Dynamic Server (IDS) - Error Messages This article describes the frequently-used error messages informix error and codes in Informix Dynamic Server (IDS) 11.50 and earlier. -239 Could not insert row - duplicate value in UNIQUE INDEX The row that is being inserted or updated contains a duplicate value of some columns on which an unique constrains is defined. Returned for repeatable read isolation, see also Error -268 -242 Could not open database table The informix error code table could not be accessed due to various reasons - file permissions, hardware errors, corrupted system catalog etc. -268 Unique constraint violated The row that is being inserted or updated contains a duplicate value of some columns on which an unique constrains is defined. For repeatable read isolation, Error -239 will be returned instead of -268. -271 Could not insert new row into the table Could not insert a row due to various reasons - disk full, locked table etc. -691 Missing key in referenced table for referential constraint A referential constraint has been violated during SQL INSERT operation on a child table that does not match a key in the parent table. -692 Key value for constraint constraint-name is still being referenced A referential constraint has been violated during SQL DELETE operation on a parent table that referenced by a child table. Ispirer Home Page Ispirer SQLWays Product Page - Migration to Informix Request SQLWays sqlways/informix/error-messages.txt · Last modified: March 20, 2013, 03:54:41 AM (external edit) © 1999-2016, Ispirer Systems Ltd.All Rights Reserved. Privacy Statement
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why do I get this error when inserting a record: duplicate value for a record with unique key up vote 1 down vote favorite Let me explain more... When inserting a record into an informix db table, if I specify a value for one of the columns, no matter what the value, it will always throw the below error (this little tidbit of info is golden and took me a while to figure out). The column is a char (4). There is no unique key index on the field that I can tell (using squirrel). There are many other columns in the table I'm setting the value on, but don't have this problem. ERROR [HY000] [Informix][Informix ODBC Driver][Informix]ISAM error: duplicate value for a record with unique key. or Error: Could not insert new row - duplicate value in a UNIQUE INDEX column. There must be something with the table schema that I'm missing... Can anyone point me in the right direction where and how to find this "supposed" unique key it's failing on (preferably using squirrel)? I've already looked at the object window under the Primary Key tab and Indexes tab and the column is not listed in either one. I can give a more info about the table schema according to squirrel: There are no primary keys, there are 10 indexes, non of which are tied to the column that's having the problem. Of the 10 indexes only 1 is a unique index. .net sql informix share|improve this question edited Aug 1 '13 at 20:09 asked Aug 1 '13 at 18:45 goku_da_master 1,6971926 1 You need to look at the indexs on the table that you are tring to INSERT to. One (or More) of those indexes specify a column (or set of columns) that may only contain any value once. The classic example of this kind of unique index is the Primary Key on the table. My first guess is that you are inserting a row with a PK value that already exists in the table - This is the most frequent reason for this error. –Declan_K Aug 1 '13 at 18:56