Returning serial value from SP, not using SQLCA
Posted in 1996
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting
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 structure is unknown to stored procedures. They use the on exception statement to return dbstatuses, but you can only return the sqlcode and isamerror, and a good insert (sqlcode = 0) won't raise an error. This procedure is being executed by a Delphi app, which needs to display the generated serial value on the user's form, and which cannot access the SQLCA structure directly. We were relying on being able to get the value as the return value of the SP. -- "And has thou slain the jabberwock? . . ." +-----------------------------+---------------------+ | Schuyler L. Southwell | PCS Health Systems | | Lead Database Administrator | 9501 E. Shea Blvd | +-----------------------------+ Scottsdale, AZ | | ssouthwe@pcshs.com | 85260 6719 | +-----------------------------+---------------------+ | Voice: 602-661-3071 | FAX: 606-391-4850 | +-----------------------------+---------------------+