Re: How to retrieve a SERIAL value in a STORED PROCEDURE ?
Posted in 1995
In article <43ttb1$l4d@hpuniv.univ-lr.fr>,
Etienne Gourdon <etienne@venus.univ-lr.fr> wrote:
>
>Hello,
>
>Is there a solution to retrieve the SERIAL number after an INSERT
>in a STORED PROCEDURE as far as the SQLCA.SQLERRD[2] does not works.
>
>Is there a better solution than this one :
>
>set lock mode ...
>lock table in share mode
>insert into zob ( num ) values ( 0 ) <------ num : serial>select max(num) into var from zob
>commit work
>
>
If you are using 7.1, then you can call the function DBINFO('sqlca.sqlerrd1')
to get the last serial value inserted. I think this capability was added
in 6.0, but I'm not positive.
dan.
--
--
dan jatnieks Siemens Rolm Communications Inc.
daniel@clipper.robadome.com http://www.siemensrolm.com/info/