retrieve a serial value after an insert via stored procedure
Posted in 1995
}
} Hello,
}
} Please answer me be EMAIL !
}
} We wanted to simulate the "sequence" ORACLE feature : to do in a same
} transaction an insert and retrieve the serial value of this insert.
This is a feature? Sounds more like a kludge.
Try:
INSERT into table (0,"00000"); RETURN dbinfo("sqlca.sqlerrd1");
}
} So, we do something like this :
}
} create procedure seq ()
} returning integer;
} define maxi integer;
} begin work;
} lock table zob in exclusive mode;
} set lock mode to wait;
} insert into zob values (0,"OOOOO");
} select max(code) into maxi from zob;
} commit work;
} return maxi;
} end procedure
}
} But we get 245 or 246 error number (ISAM 113)
} I heard about INFORMIX bug in 5.01, is it true ?
}
--
_____________________________________________________________________________
Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA
jparker@hpbs3645.boi.hp.com
_____________________________________________________________________________
"I'm with the IRS, I'm here to help you"
_____________________________________________________________________________
Any opinions expressed herein are my own and not those of my employers.
_____________________________________________________________________________