How to retrieve a SERIAL value in a STORED PROCEDURE ?
Posted in 1995
>
>
> 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
As of 5.1 you can use dbinfo.
INSERT ......
LET ser = dbinfo("sqlca.sqlerrd1")
cheers
j.
_____________________________________________________________________________
Jack Parker - Hewlett Packard, BSMC Boise, Idaho, USA
jparker@hpbs3645.boi.hp.com
_____________________________________________________________________________
Back up my hard drive? You mean these things can actually run in reverse?
_____________________________________________________________________________
Any opinions expressed herein are my own and not those of my employers.
_____________________________________________________________________________