Re: Returning serial value from SP, not using SQLCA
Posted in 1996
> > > > > Does anyone know if there is a way to return, from a stored procedure which > > inserts a row with a serial column, the VALUE of the serial number, without > > doing a second select? sqlca.sqlerrd[2] should contain the value, but the sqlca > > Actually the sqlca structure is not unknown to SP. At least it is not > unknown to my version, Online version 7.1. I get the serial number back > by using this routine. > > LET sernum = dbinfo("sqlca.sqlerrd1~); > > Admittedly I had to pay good money for the class on Stored procedures to > learn this. > Ok, I give. Mssr. Elder is quite correct. You can do the above from version 6.0 on. With versions prior to 5.0 it's not an issue because you don't have SPLs. With version 5.0 you're SOL. With version 5.1 - 5.999999999999999999999999999999 you have to do something else. I'd replicate it, but it is in the FAQ. (err isn't it?) cheers j. _____________________________________________________________________________ Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA jparker@boi.hp.com Currently on loan to PLD/PE _____________________________________________________________________________ If anything can go wrong, fix it. To hell with Murphy. _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________