RE: Getting value of serial column after insert inside stored procedure, help!
Posted in 1995
Vaishali, >I am inserting a record in a stored procedure for a table having >a serial column, now I want to find out the value the serial >column got assigned and return it. > >I know it gets assigned in sqlca.sqlerrd[1], but thats useful in >4gl or esql program, can this structure be accessed in a stored >procedure? Any pointers will be a great help. Thanks! If your engine version has the dbinfo() function then you can access sqlca.sqlerrd1. I'm not sure which version introduced this (6.0?) so just try it. LET new_srl = DBINFO('sqlca.sqlerrd1'); Before that, there was a tricky way to get the value using an insert trigger, a second stored procedure and a global spl variable. If you don't have the DBINFO expression and can't upgrade, write me for the details. --Craig (craig@chemistry.utah.edu)