unique keys
Posted in 1997
Topics: Performance & Tuning
Dear Informix/Illustra users. I have a problem to create rows with unique keys: I have created a table like this: * create table pat ( idpat integer not null primary key, firstname text, -- Fisrt Letter Upper case, others in lower lastname text, -- Fisrt Letter Upper case, others in lower sex char, -- F|f or M|m birthday date, -- Patient birthday handedness char, -- L|l= Left R|r= Right secunum char(20), -- Securite social num info geninfo_t, -- general informations check ( handedness='L' or handedness='R' or handedness='l' or handedness='r'), check (sex='M' or sex='F' or sex='m' or sex='f') ); When I insert a new row manually, there is no problems: * insert into pat(idpat,firstname,lastname,sex,handedness) values (0,'DIALLO','Barrou','M','R'); one row inserted But when I attempt to insert automatically a new roaw with a incremental idpat, the system fails : * insert into pat(idpat) select MAX(idpat)+1 from pat; XQ0002:Optimizer Internal Error: unknown node type Have anyone an idea to correct this problem , or an other solution to generate a unique key automaticlly. Thank you very much for your help.