DB2 delete one table constrained by another run from CL
Posted on 2013-06-26
I have a simple delete query with a subselect
Delete from Table1 T1 where F1 in (Select F2 from Table2 T2 where T1.F1 = T2.F2 and T2.F3 = 'constantvalue')
I have done this many times and interactively it works fine, but when I try to execute the sql from a CL with RUNSQLSTM SRCFILE(XX/YY) SRCMBF(ZZZZ) it fails to run with the following error:
SQL7008 Position 1 Table1 in XX not valid for operation
I know that uncorrelated sub-selects can cause issues when running from a CL but that is not the case here, any suggestions?