HOW TO GET SERIAL VALUE IN SPL
Posted in 1998
This is a multi-part message in MIME format. --------------E4E0C60211751FF790CA7B31 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi All! My problem is: How can I get (in STORED PROCEDURE) the value of a SERIAL column of a newly inserted row? In 4GL, I can use SQLCA.SQLERRD[2], but it seems not to work in SPL (I get systax error when i try to CREATE procedure with SQLCA.SQLERRD. Also, in data types section of SPL Reference I found no mention of record syntax which implies to me that there are no records in SPL). As SQLCA record contains a set of valuable information, it seems very strange to me that I can]t obtain this information in SPL. Is there another place to look for this information? If no, is there another possiblity to get the last inserted SERIAL value. Of course, I can't just SELECT MAX(...) in multiuser environment. In my database, almost each table has SERIAL primary key and when I tried to move some logic from 4GL code to Stored Procedures, i was stopped by the problem. TIA Jacek --------------E4E0C60211751FF790CA7B31 Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Jacek M'drzycki Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: Jacek M'drzycki n: M'drzycki;Jacek org: Zak'ad Energetyczny Warszawa-Teren S.A adr: ul. Marsa 95;;04-470 WARSZAWA; POLAND;;;;Poland email;internet: jacekmx@friko4.onet.pl title: Database Adm&Dev tel;work: (+48 22) 611-96-85 ext. 418 x-mozilla-cpt: ;0 x-mozilla-html: FALSE end: vcard --------------E4E0C60211751FF790CA7B31--