Hello.
v8.2.1
Anybody can try this:
----------
--base table
DECLARE GLOBAL TEMPORARY TABLE SESSION.T (I INT)
with replace on commit preserve rows;
--insert 10 rows into table t
INSERT INTO SESSION.T
with t(v) as
(
VALUES (1) union all select v+1 from t where v<10
)
select * from t;
--reference
DECLARE GLOBAL TEMPORARY TABLE SESSION.R
(IND INT GENERATED ALWAYS AS IDENTITY, I INT)
with replace on commit preserve rows;
--insert 10 rows into table r
INSERT INTO SESSION.R (I)
with t(v) as
(
VALUES (1) union all select v+1 from t where v<10
)
select * from t;
--try to update table t
--by random value from reference
update SESSION.T
set I=
(
select IND from session.r where IND=1+round(rand()*(10-1), 0)
);
----------
After last statement I get SQL0811N.
But it's impossible I think because SESSION.R.IND is GENERATED ALWAYS
AS IDENTITY.
How it could be?
Sincerely,
Mark B.