Re: 4GL question
Posted in 1992
In article <1992Oct26.163233.16252@hpcvusn.cv.hp.com> thaddeus@hpcvusd.cv.hp.com (Thaddeus Konar) writes: >I have a question (which might be silly one): >I am new to I4GL. When I insert a data into a table, where primary >key is define as serial, how do I get back the assigned ID number. >Right now I SELECT the row after INSERT with all the known values >and read the PK column value. It seems to me that this is not efficient >and there must be a better way. Ah, I love easy questions! The short answer is, sqlca.sqlerrd[2] A slightly longer answer would be, whenever error continue insert into.... if sqlca.sqlcode == 0 then display "new row number is ", sqlca.sqlerrd[2] display "its rowid is ", sqlca.sqlerrd[6] else display "insert error code ",sqlca.sqlcode display "with isam code ",sqlca.sqlerrd[2] end if