Re: Delete error with serial field.
Posted in 1993
}From: e583442@nspp08.ci.in.ameritech.com (Gene Hegarty) }Subject: Delete error with serial field. }Date: Wed, 10 Nov 93 17:18:15 EST }X-Informix-List-Id: <list.3081> } }I am trying to delete from a table with a serial type field in it and }am getting the follwoing error: } }ISAM error: duplicate value for a record with unique key. } }It turns out that this error will only happen when there are zero rows that }match my delete criteria. I have been able to duplicate the problem as }follows: } }Isql command to create a table: } create table temp (data char(10), serial_field serial unique); } }4gl code to duplicate problem: } database support } main } delete from temp where data = "No match" } if status then } call err_print(status) } sleep 5 } end if } end main } }This will give me the error when there is not an entry of data="No match". }If anyone has any ideas on how to get around this problem I would appreciate }the help. } }Informix Version: } Informix-4GL RDS Version 4.10.UD1 I believe you forgot to mention that the database is running MODE ANSI. You also forgot that errors are negative, and the DELETE is returning the value NOTFOUND (+100). When passed to ERR_PRINT() this is being interpreted as the C-ISAM error. Fix: don't try printing the error message unless the status is negative. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>