×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hi Rob,
Thanks for that. I think I saw the same article (400 Guru Treasury Of New
DB2 6.1 Features, Part 1: Query Enhancements).
Tried equivalent of
select rrn(inserttab), identitycol
from final table (insert into rob/delmex (mytext)
values('test'))
as inserttab
but always got 1 back as the rrn :(
Regards,
Kevin Wright
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of rob@xxxxxxxxx
Sent: Thursday, 25 February 2010 3:18 PM
To: Midrange Systems Technical Discussion
Subject: RE: After an SQLCLI INSERT, is there a way of getting the
relative record number of the record inserted?
Based on this:
CREATE TABLE ROB/DELMEx
(IDENTITYCOL INT NOT NULL WITH DEFAULT as identity,
MYTEXT CHAR (5 ) NOT NULL WITH DEFAULT)
You CAN'T do this:
select rrn(delmex),identitycol
from final table (insert into rob/delmex (mytext)
values('test'))
But you CAN do this:
select identitycol
from final table (insert into rob/delmex (mytext)
values('test'))
And this will return the automatically generated sequence number.
Requires 6.1
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/sqlp/rbafysfin
s.htm
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.