I found the reason: it was the trailing semicolon.
This one fails - mind that the command ends with ;
db2 => LOAD FROM mycurs OF cursor INSERT INTO test.table2;
SQL3304N The table does not exist.
But, this one works - mind that the command does not end with ;
db2 => LOAD FROM mycurs OF cursor INSERT INTO test.table2
SQL3501W The table space(s) in which the table resides will not be placed in
backup pending state since forward recovery is disabled for the database.
SQL1193I The utility is beginning to load data from the SQL statement "
select * from test.table2".
...
I am used to oracle syntax , where ; is expected in the end of any command. I guess this is not the case in db2.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…