How can i ...
Posted in 1992
Hi, I'm programming in SQL Windows on a PC. I acces an Informix Database on a Unix machine via a gateway. Here is my problem: I want to insert a record in a table with a primary key of type SERIAL and obtain the generated value of the primary key in a variable in my application. If I do a select max(primary-key-column) from table-name just after the insert, I'm not sure that another user did not insert a new record in the time between my 'insert' an my 'select'. Perhaps the result of my 'select' will not be correct. I'd like to find a solution without blocking the whole table. Can someone help me ? Thanks in advance. -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* ~ ~ * ~ * Laurence Humblet :-) * Merry *** Happy * ~ Centre Software de Liege (Belgium) ~ ***~* ~ * Siemens-Nixdorf * Christmas **~**** New * ~ ~ *****~*** ~ * E-Mail: Laurence@cls.sni.be * *~*****~*** Year 93 * ~ Phone : (32)41/20-16-55 ~ ****~******** ~ * * *** * ~ ~ *** ~ *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*