on 2024 Feb 02 6:04 AM
Take this example
create table Test1 (colA integer); create table Test2 (colB integer); insert into Test2 (colB) select new1.colA from (insert into Test1 (colA) values (1)) referencing (final as new1)
After this tables Test1 and Test2 both contain 1 record, which is what I expected. Now try this:
create table Test3 (colA integer); create table Test4 (colB integer); create table Test5 (colC integer); insert into Test5 (colC) select new4.colB from (insert into Test4 (colB) select new3.colA from (insert into Test3 (colA) values (2) ) referencing (final as new3) ) referencing (final as new4)
You don't get any errors, but the result is not what I expected. Only in table Test3 a record is inserted. Tables Test4 and Test5 remain empty.
From the help: "The dml-derived-table statement can only reference one updatable table; updates over multiple tables return an error. Also, selecting from dml-statement is not allowed if the DML statement appears inside a correlated subquery or common table expression because the semantics of these constructs can be unclear."
I'm not quite sure if this last part in the help is trying to explain that what I'm trying to do here doesn't work.
So basically my question is: is this a known limitation or a bug?
And if it's a known limitation: an exception would be appreciated in such a situation so it's clear immediately that this is not supported.
Request clarification before answering.
User | Count |
---|---|
74 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.