We had an implementation where VTs were being created in dynamic-SQL .... and after some update patch installation same SPs running for months started to fail. On investigation we had to do following to make it work again:
DECLARE MyUser VARCHAR(30);
SELECT TRIM(USER) INTO MyUser;
CALL DBC.SysExecSQL('CREATE volatile table ' || MyUser || '.TableName1(Col1 BIGINT ) ON COMMIT PRESERVE ROWS;');
Try creating via Dynamic SQL.
don't care, this should be no error, but a warning message, i.e. the SP still gets created.
When the VT doesn't exist in the current session, there's this warning message for the INSERT, but when it exists you probably get a "table already exists" warning for the CREATE :-)
Thank you very much for the information.
I have created the Volitile Tables first and then created the Stored Procedure.
Now it gives warnings saying
SPL5000:W(L46), E(3803):Table 'vt_TableSrc' already exist.
This indicates a "Warning". Now I can call the Stored Procedure and it is working fine.